Click here to Skip to main content
15,915,864 members
Home / Discussions / C#
   

C#

 
GeneralRe: Win CE software re-boot Pin
Richard W Allen17-Mar-10 1:07
Richard W Allen17-Mar-10 1:07 
GeneralRe: Win CE software re-boot Pin
Xmen Real 17-Mar-10 4:09
professional Xmen Real 17-Mar-10 4:09 
QuestionHow to Implement Security application block? Pin
amit_8316-Mar-10 23:53
professionalamit_8316-Mar-10 23:53 
AnswerRe: How to Implement Security application block? Pin
Keith Barrow17-Mar-10 0:19
professionalKeith Barrow17-Mar-10 0:19 
GeneralRe: How to Implement Security application block? Pin
amit_8317-Mar-10 0:33
professionalamit_8317-Mar-10 0:33 
GeneralRe: How to Implement Security application block? Pin
#realJSOP17-Mar-10 1:50
professional#realJSOP17-Mar-10 1:50 
Questioncreating Dynmaic Objects in C# Pin
Anil Kumar.Arvapalli16-Mar-10 23:33
Anil Kumar.Arvapalli16-Mar-10 23:33 
AnswerRe: creating Dynmaic Objects in C# Pin
OriginalGriff16-Mar-10 23:52
mveOriginalGriff16-Mar-10 23:52 
This is basic stuff, you should read a C# book as you will get a much more detailed explanation than we can put here (and probably easier to follow):

In your example:
string[] drives = GetLogicalDrives();
Returns an array of strings, each containing a name (lets say) of a drive.
Use a foreach loop, rather than a for loop - you don't need to know how many drives there are.
foreach (string drive in drives)
   {
   DriveInfo di = new DriveInfo(drive);
   ... do something with the drive.
   }
DriveInfo is a class which I invented to return info about a drive given its name. Each time you deal with a different drive from the drives array, you create a new instance of DriveInfo to handle it, with the new keyword.

Does that answer your question?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

GeneralRe: creating Dynmaic Objects in C# Pin
AspDotNetDev17-Mar-10 0:56
protectorAspDotNetDev17-Mar-10 0:56 
GeneralRe: creating Dynmaic Objects in C# Pin
OriginalGriff17-Mar-10 1:16
mveOriginalGriff17-Mar-10 1:16 
GeneralRe: creating Dynmaic Objects in C# Pin
Greg Chelstowski17-Mar-10 1:36
Greg Chelstowski17-Mar-10 1:36 
Questionchar array to string Pin
Member 59031016-Mar-10 21:54
Member 59031016-Mar-10 21:54 
AnswerRe: char array to string Pin
Nuri Ismail16-Mar-10 22:04
Nuri Ismail16-Mar-10 22:04 
AnswerRe: char array to string Pin
Richard MacCutchan16-Mar-10 22:04
mveRichard MacCutchan16-Mar-10 22:04 
GeneralRe: char array to string Pin
AspDotNetDev16-Mar-10 22:55
protectorAspDotNetDev16-Mar-10 22:55 
QuestionRetrieving GMail Contacts Pin
Anil Kumar.Arvapalli16-Mar-10 20:10
Anil Kumar.Arvapalli16-Mar-10 20:10 
AnswerRe: Retrieving GMail Contacts Pin
Russ-T16-Mar-10 20:19
Russ-T16-Mar-10 20:19 
QuestionConnecting to Remote SQL Server Pin
benzima16-Mar-10 15:59
benzima16-Mar-10 15:59 
AnswerRe: Connecting to Remote SQL Server Pin
PIEBALDconsult16-Mar-10 17:06
mvePIEBALDconsult16-Mar-10 17:06 
AnswerRe: Connecting to Remote SQL Server Pin
Russ-T16-Mar-10 17:57
Russ-T16-Mar-10 17:57 
QuestionGeneric event? Pin
Sirenfal16-Mar-10 15:04
Sirenfal16-Mar-10 15:04 
AnswerRe: Generic event? Pin
PIEBALDconsult16-Mar-10 15:44
mvePIEBALDconsult16-Mar-10 15:44 
GeneralRe: Generic event? Pin
Sirenfal16-Mar-10 16:30
Sirenfal16-Mar-10 16:30 
AnswerRe: Generic event? Pin
Gideon Engelberth16-Mar-10 18:06
Gideon Engelberth16-Mar-10 18:06 
GeneralRe: Generic event? Pin
Sirenfal16-Mar-10 18:34
Sirenfal16-Mar-10 18:34 

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.