Click here to Skip to main content
15,914,481 members
Home / Discussions / C#
   

C#

 
AnswerRe: send ICMP packet like PING in .net? Pin
Daniel Turini22-Jun-04 8:18
Daniel Turini22-Jun-04 8:18 
AnswerRe: send ICMP packet like PING in .net? Pin
eggie522-Jun-04 8:49
eggie522-Jun-04 8:49 
AnswerRe: send ICMP packet like PING in .net? Pin
yoaz22-Jun-04 22:26
yoaz22-Jun-04 22:26 
Generalconverting vb.net code to c# Pin
vijju0422-Jun-04 7:44
vijju0422-Jun-04 7:44 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:18
protectorHeath Stewart22-Jun-04 8:18 
GeneralRe: converting vb.net code to c# Pin
vijju0422-Jun-04 10:28
vijju0422-Jun-04 10:28 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 10:36
protectorHeath Stewart22-Jun-04 10:36 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:29
protectorHeath Stewart22-Jun-04 8:29 
Besides, do you maybe want to put this in context? What are you trying to do? Extract a value from a collection? If all you did was convert from one language to another, you're constrained by what the rest of the code did.

Now, if you convert the concept, you could use many types to do this. For example, you could use a Hashtable or StringDictionary (or several other things in the BCL) to store string key/value pairs and refer to them by name:
StringDictionary dict = new StringDictionary();
dict["One"] = "Apple";
dict["Two"] = "Orange";
dict["Three"] = "Banana";
Console.WriteLine(dict["Two"]); // Prints Orange to the console.
When moving from one application framework to another, don't just convert your code. Advancements are made with newer frameworks. If all you're doing is porting your code just to run on the .NET Framework, you're doing a very stupid thing (any article by a decent author will tell you as much) - if it works, don't change it. If you have to change it to add new functionality later and to be maintainable by less-than-knowledge programmers, then change it in steps.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: converting vb.net code to c# Pin
LongRange.Shooter22-Jun-04 10:00
LongRange.Shooter22-Jun-04 10:00 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 10:32
protectorHeath Stewart22-Jun-04 10:32 
GeneralAuto adjust column width Pin
vcorn22-Jun-04 7:44
vcorn22-Jun-04 7:44 
GeneralRe: Auto adjust column width Pin
Heath Stewart22-Jun-04 8:12
protectorHeath Stewart22-Jun-04 8:12 
GeneralHelp me with an e-mail. Pin
svenakela22-Jun-04 7:36
svenakela22-Jun-04 7:36 
Generalconverting vb.net code to c# Pin
vijju0422-Jun-04 7:35
vijju0422-Jun-04 7:35 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:06
protectorHeath Stewart22-Jun-04 8:06 
GeneralSaving a collection of a class into form`s code. Pin
Member 114126622-Jun-04 6:41
Member 114126622-Jun-04 6:41 
GeneralRe: Saving a collection of a class into form`s code. Pin
Heath Stewart22-Jun-04 8:04
protectorHeath Stewart22-Jun-04 8:04 
GeneralRe: Saving a collection of a class into form`s code. Pin
Member 114126622-Jun-04 20:00
Member 114126622-Jun-04 20:00 
GeneralRe: Saving a collection of a class into form`s code. Pin
Heath Stewart22-Jun-04 20:11
protectorHeath Stewart22-Jun-04 20:11 
QuestionSuppress click at load??? Pin
betterc22-Jun-04 6:39
betterc22-Jun-04 6:39 
AnswerRe: Suppress click at load??? Pin
Heath Stewart22-Jun-04 8:02
protectorHeath Stewart22-Jun-04 8:02 
GeneralWindows Service Problem (Capture screen) Pin
Milos.Sakovic22-Jun-04 5:15
Milos.Sakovic22-Jun-04 5:15 
GeneralRe: Windows Service Problem (Capture screen) Pin
Heath Stewart22-Jun-04 6:22
protectorHeath Stewart22-Jun-04 6:22 
QuestionPropertyGrid for Remote object? Pin
zericsson22-Jun-04 5:15
zericsson22-Jun-04 5:15 
GeneralDirectPlay Pin
bouli22-Jun-04 4:32
bouli22-Jun-04 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.