|
I have figured out the problem, firstly according http RFC we should not make more the two connection to a web server,hence .NET complies with it and by default allows us to make only two connections to the web server,it can be changed fairly easily by making changes to machine.config file.
But there are various other aspects which should be taken care while doing so,in order to get maximum out of your multi threaded application.Please refer to following links they will to remove all doubts.
http://codebetter.com/blogs/steve.hebert/archive/2006/07/14/147371.aspx
http://codebetter.com/blogs/steve.hebert/archive/2006/07/20/147565.aspx
http://blogs.msdn.com/tess/archive/2006/02/23/537681.aspx
|
|
|
|
|
Hello
I want to use multithreading in my application. But i have not more idea about this. So plz help me, if someone can.
Thanks
Devesh Mishra
|
|
|
|
|
you can search on net for threading details or read some book on it
anyhow see the following links
http://www.codeproject.com/csharp/threader.asp
http://www.albahari.com/threading/
with vs.net 2005 it's more easier to use threads. You just have to drag/drop the backgroundworker control and code on it's appropriate event
|
|
|
|
|
Thanks. I have done it..
Devesh Mishra
|
|
|
|
|
Google with this keyword "C# Multithreading".
|
|
|
|
|
search in msdn for Boolean Threading
|
|
|
|
|
hi all,
Can anyone help me with the code for getting the external ip of my machine using C# windows application?
Thanks in advance
Regards
Anuradha
|
|
|
|
|
|
hi michael,
i need to know the external ip given by the ISP provider when connected to the internet.i need the code to achieve this.
Hope i am clear now.
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Have to tried the link above?
I think it should work.
|
|
|
|
|
The first result here[^] looks promising.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
|
|
I just installed directX 9.0 and it sits in the directory DXSDK, how to do set my C# to talk to the directX components???
Thanks
samuel
|
|
|
|
|
You asked a mouthfull. And the SDK is more C++ oriented far as when i last checked it out.
In a C# App you can Add Reference..."Microsoft.DirectX" and "Microsoft.DirectX.Direct3DX" (for the version you want to work with)
of course DirectSound etc aswell if you need it.
However if you are wanting to make 3D games using DX then this might be a better starting point:
Microsoft XNA Studio
http://msdn.microsoft.com/xna/[^]
Comes with a space shooter game and all source code in C# all working. Could be eaiser for you if you are new to DX
Other options are less 'clean' for use with C#, but there is alow of code available on the net just google it.
Either way good luck
Always more to learn, and i wouldn't have it any other way.
|
|
|
|
|
Good day,
I want to justify the text in my listbox. I've try to insert items in which both have the same length however the amount area won't align considering both items have the same length. How can I make the listbox justify its items so that both amount are on the right edge?
Here is the code that i've tried but items arent justified:
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
string stramount1 = "900.00";<br />
string stramount2 = "3400.00";<br />
string description1 = "Basic Salary......................"+stramount1; <br />
string description2 = "Basic Salary....................."+stramount2;<br />
<br />
listBox1.Items.Add(description1);<br />
listBox1.Items.Add(description2);<br />
}<br />
thanks.
|
|
|
|
|
Simple answer? You dont
You could try measuring the text width and calculate the remaining space and fill it with calulated amount of spaces however you wont be able to get exact alignment as spaces in each font have a set size more than one pixel.
Delete your listbox and add a listview control and use that
You can add columns (so each part has a header), change alignment of each column and its easy to add items:
<br />
ListViewItem MyItem = new ListViewItem(new string[] {"Bob Marley","$10,000"} );<br />
listView1.Items.Add(MyItem);<br />
or
<br />
string sDescription = "Bob Marley";<br />
string sSalary = "$10,000";<br />
<br />
ListViewItem MyItem = new ListViewItem(new string[] { sDescription, sSalary });<br />
listView1.Items.Add(MyItem);<br />
-- modified at 0:50 Monday 9th July, 2007
Just to be clear, this is all considering there is more than one column... if you just need the salary in there and nothing else and want it right aligned you set the RightToLeft property to Yes. Thought i should cover all bases
Always more to learn, and i wouldn't have it any other way.
|
|
|
|
|
Hi,
if you really want to do that with a ListBox there are two ways:
1.
select a "non-proportional" font (such as "Courier New") where all characters
have the same width; then adjust the spaces/dots/whatever in your strings so
they all have the same length.
or
2.
Choose to draw the ListBox items yourself, by setting DrawMode to OwnerDraw;
and provide a handler for the DrawItem event (similar to a paint handler when
drawing in say a Panel). You do know the items in a ListBox dont have to be
strings ? They can be instances of whatever class you come up with, and
your DrawItem handler could make use of that...
|
|
|
|
|
how to insert,update,to fill data to datagrid..using XML?
|
|
|
|
|
Hope the article by rudy.net here[^] in CP will help you.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Ok to start i'll tell you what im doing, I have a InterOpWindow class that i created. It basically allows me easy talking between Process's and Thread's allowing me to just send strings all over however i like.
eg, to setup a window to talk to:
<br />
InterOpWindow MyCommandWindow = new InterOpWindow("some_window_name");<br />
MyCommandWindow.evDataCommandRecieved += new InterOpWindow.delDataRecieved(OnDataCommandRecieved);<br />
<br />
static void OnDataCommandRecieved(string sData)<br />
{<br />
MessageBox.Show("Data: " + sData);<br />
}<br />
and to send data and check a window reference:
<br />
InterOpWindow.SendRemoteMessage("some_window_name", "my data message");<br />
InterOpWindow.CheckRemoteWindow("some_window_to_check");<br />
Nice and easy... just how i like it, im happy i got it working as i've only been C# coding for about 3 weeks heh.
Which is where i come to my problem with the timer class. What i assumed was fine was to keep enabling and disabling it to start and stop the monitoring process for command sending timeouts. However after the timer being used (and working) it seems to be 'dead' if i try to disable then enable it... the Tick event never fires.
Is the object being disposed? does it need a container to stay active? any thoughts would be great...
For now im just leaving it enabled for good and using a var to count around 3 ticks (1 second each) for timeout.
Of course i could have just stuffed up completely and its something small... ya never know
<br />
public class InterOpWindow : NativeWindow<br />
{<br />
...<br />
private Timer tmrTimeout = new Timer();<br />
...<br />
public InterOpWindow(string sLocalWindowName)<br />
{<br />
...<br />
tmrTimeout.Tick += new EventHandler(tmrTimeout_Tick);<br />
}<br />
}<br />
thats basically how i've set it up, any ideas would be great... thanks
Always more to learn, and i wouldn't have it any other way.
|
|
|
|
|
DMWhiteDragon wrote: Is the object being disposed?
Good guess. The MSDN documentation on Forms.Timer clearly states on Enabled:
"The timer is not subject to garbage collection when the value is true."
This means there are two ways to keep a Forms.Timer alive (i.e. not collected):
1. make sure it is running
2. make sure to keep a reference to it (in a private member of one of your classes
as opposed to in a local variable of a method that has returned)
|
|
|
|
|
Thanks for the reply, i swear i checked MSDN and google... but ya can't always get a straight thought in ya head when you a little fustrated
Seems i'll have to keep the way im doing it, as its already a private member of the class and its still being difficult.
I could use the API Timer i guess but that seems messy yes? Is there any other Timers hidden somewhere in this mind bogginly huge framework that might suit?
Always more to learn, and i wouldn't have it any other way.
|
|
|
|
|
Hi,
1.
There is also Threading.Timer and Timers.Timer; both of them run their handler
on a separate thread, not the GUI thread. And you must keep them alive too.
2.
I fail to see how exactly your timer might be collected: if you are able
to set its Enabled property true again, that means you are holding a reference,
so I believe something else is going on. If you need more help, show us the code !
|
|
|
|
|
Well i did some more testing
I moved the class to a new blank project and forced some timeouts and its working fine, enabled/disabled/enabled etc. Go figure :/
So its bound to be something else, i'll get onto the other coders in the project and perhaps break one of their arms for making me think my class was broke
Always more to learn, and i wouldn't have it any other way.
|
|
|
|