Click here to Skip to main content
16,006,605 members
Home / Discussions / C#
   

C#

 
GeneralRe: Deployment Project - cyrillic Pin
Ravenet11-Mar-08 17:17
Ravenet11-Mar-08 17:17 
GeneralRe: Deployment Project - cyrillic Pin
nike_arh12-Mar-08 2:23
nike_arh12-Mar-08 2:23 
QuestionProblems with regular expressions Pin
pcaeiro11-Mar-08 9:54
pcaeiro11-Mar-08 9:54 
GeneralRe: Problems with regular expressions Pin
User 665811-Mar-08 10:35
User 665811-Mar-08 10:35 
GeneralRe: Problems with regular expressions Pin
pcaeiro12-Mar-08 0:28
pcaeiro12-Mar-08 0:28 
GeneralRe: Problems with regular expressions Pin
Ravenet11-Mar-08 17:23
Ravenet11-Mar-08 17:23 
GeneralRe: Problems with regular expressions Pin
pcaeiro12-Mar-08 0:40
pcaeiro12-Mar-08 0:40 
GeneralProblems with C# Examples Pin
Jammer11-Mar-08 9:54
Jammer11-Mar-08 9:54 
Hi All,

This has to be one of the most common things I'm encountering when looking at MSDN Examples.

I'm wnating to grab a list of the logical drives on my computer. Dead simple ... ?

So I looked up some examples and found this on MSDN (i've always used Directory.GetLogicDrive();) so I thought I'd give this a try.

// Sample for the Environment.GetLogicalDrives method
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine();
    String[] drives = Environment.GetLogicalDrives();
    Console.WriteLine("GetLogicalDrives: {0}", String.Join(", ", drives));
    }
}
/*
This example produces the following results:

GetLogicalDrives: A:\, C:\, D:\
*/


Putting the line:

String[] drives = Environment.GetLogicalDrives();

Yields an error saying that drives doesn't exist in this context. How can such a simple example not work in my code? I'm Confused!!

Jammer

Going where everyone here has gone before! Smile | :)

GeneralRe: Problems with C# Examples Pin
Guffa11-Mar-08 10:03
Guffa11-Mar-08 10:03 
GeneralRe: Problems with C# Examples Pin
Jammer11-Mar-08 10:08
Jammer11-Mar-08 10:08 
GeneralRe: Problems with C# Examples Pin
Guffa11-Mar-08 10:51
Guffa11-Mar-08 10:51 
GeneralRe: Problems with C# Examples Pin
Jammer11-Mar-08 10:04
Jammer11-Mar-08 10:04 
GeneralRe: Problems with C# Examples Pin
Scott Dorman11-Mar-08 10:28
professionalScott Dorman11-Mar-08 10:28 
GeneralRe: Problems with C# Examples Pin
Jammer11-Mar-08 10:30
Jammer11-Mar-08 10:30 
GeneralRe: Problems with C# Examples Pin
Christian Graus11-Mar-08 10:39
protectorChristian Graus11-Mar-08 10:39 
GeneralOT Pin
Pete O'Hanlon11-Mar-08 12:08
mvePete O'Hanlon11-Mar-08 12:08 
GeneralRe: OT Pin
Jammer11-Mar-08 13:09
Jammer11-Mar-08 13:09 
GeneralRe: OT Pin
Luc Pattyn11-Mar-08 15:13
sitebuilderLuc Pattyn11-Mar-08 15:13 
GeneralRe: OT Pin
Jammer11-Mar-08 15:26
Jammer11-Mar-08 15:26 
GeneralRe: OT Pin
Luc Pattyn11-Mar-08 16:14
sitebuilderLuc Pattyn11-Mar-08 16:14 
GeneralRe: OT Pin
Pete O'Hanlon11-Mar-08 23:19
mvePete O'Hanlon11-Mar-08 23:19 
GeneralRe: OT Pin
Jammer12-Mar-08 8:57
Jammer12-Mar-08 8:57 
GeneralMacros Pin
ellllllllie11-Mar-08 9:18
ellllllllie11-Mar-08 9:18 
GeneralRe: Macros Pin
Christian Graus11-Mar-08 9:27
protectorChristian Graus11-Mar-08 9:27 
GeneralRe: Macros Pin
Guffa11-Mar-08 10:31
Guffa11-Mar-08 10:31 

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.