|
|
Hi,
I was checking on of our dlls using Resourcer, and found that Switch case was converted to If - Else loop in the dll. Is this done by framework compiler or by Resourcer?
If this is done by the compiler, why don't we directly use If - Else instead if Switch case?
Could anyone throw some light on this?
Regards,
Blumen
|
|
|
|
|
Not sure. I'd suspect the compiler decides how to generate the IL code...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi ,
How can I Set the Parent of Control On Any Form to Desktop?
ie. want to set controls parent as Desktop ,not the form which contains
the control.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
I have written all the commands required to do live serach in a method.I am calling that method asynchronously using threads.Although I have created 20 threads and calling the search method from all these 20 threads.(It's Like If have a paragraph with 20 sentences, I want to call my search method 20 times asynchronously without waiting for first one to complete. )The problem is when I moniter my network traffic I can only see 2 connections to the server Instead of 20.Can anybody tell me what is the problem why I can't make 20 connections to MSN Live server.From my programs trace I can see that all 20 treads are being created and callback is also happening for all 20, but what I feel they all are using same 2 connections thus I can't see a boost in performance.
Note I am using synchronous version of MSN web Search method.
|
|
|
|
|
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
|
|
|
|