Click here to Skip to main content
14,920,488 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get Time Tracking Application in c#.net? Pin
CHill6013-Jan-15 2:24
mveCHill6013-Jan-15 2:24 
QuestionNeed Some suggection on E-Mail Marketing Software Pin
Er. Pradeep Kumar Rai12-Jan-15 22:36
MemberEr. Pradeep Kumar Rai12-Jan-15 22:36 
AnswerRe: Need Some suggection on E-Mail Marketing Software Pin
OriginalGriff12-Jan-15 23:38
mveOriginalGriff12-Jan-15 23:38 
GeneralRe: Need Some suggection on E-Mail Marketing Software Pin
Er. Pradeep Kumar Rai13-Jan-15 1:34
MemberEr. Pradeep Kumar Rai13-Jan-15 1:34 
GeneralRe: Need Some suggection on E-Mail Marketing Software Pin
OriginalGriff13-Jan-15 1:42
mveOriginalGriff13-Jan-15 1:42 
AnswerRe: Need Some suggection on E-Mail Marketing Software Pin
Chris Quinn13-Jan-15 2:30
MemberChris Quinn13-Jan-15 2:30 
QuestionPassing Array of custom objects as an attribute to a custom object in ODP.Net Pin
Member 960130912-Jan-15 19:55
MemberMember 960130912-Jan-15 19:55 
QuestionHow to get a list of all drive letters including mapped network drives Pin
robwm112-Jan-15 9:28
Memberrobwm112-Jan-15 9:28 
Hi,

I have been searching for several hours about how to get a list of all drive letters in use. All of the code examples I have tried were able to list all drive letters in use but did not include mapped network drives.

I have tried DriveInfo, Directory.GetLogicalDrives and attempted to use WMI through the ManagementObjectSearcher. Win32_DiskDrive and Win32_LogicalDisk lists all drives except mapped network drives. If I use Win32_NetworkConnection or Win32_MappedLogicalDrive using Scriptomatic, only the network drive is listed but when those WMI classes are in my C# code, nothing seems to happen with my application. No output is ever produced.

There is some conversation around the Win32 API but 100+ lines of code seems a bit overkill to map a single drive unless that is the only way it can be done.

A few others mentioned not to use 'NET USE' so I have avoided that in favor of using a native C# code. I want to follow C# best practices as closely as possible.

Ultimately I would like to use the next available drive letter to map to a network share but I need some way to be certain that the next available drive letter is not in use by a network share that the methods I have been using cannot see. I haven't found any complete code in one place (or even across many places) that can accomplish this.

Thanks,
Rob
AnswerRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff12-Jan-15 21:57
mveOriginalGriff12-Jan-15 21:57 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
robwm113-Jan-15 5:04
Memberrobwm113-Jan-15 5:04 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff13-Jan-15 5:06
mveOriginalGriff13-Jan-15 5:06 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
robwm113-Jan-15 8:25
Memberrobwm113-Jan-15 8:25 
GeneralRe: How to get a list of all drive letters including mapped network drives Pin
OriginalGriff13-Jan-15 8:37
mveOriginalGriff13-Jan-15 8:37 
QuestionHow to plot data into the graph which is receive from com port Pin
Member 1129798112-Jan-15 3:40
MemberMember 1129798112-Jan-15 3:40 
AnswerRe: How to plot data into the graph which is receive from com port Pin
Afzaal Ahmad Zeeshan12-Jan-15 4:24
mveAfzaal Ahmad Zeeshan12-Jan-15 4:24 
AnswerRe: How to plot data into the graph which is receive from com port Pin
V.12-Jan-15 21:12
professionalV.12-Jan-15 21:12 
QuestionStatic constructor? Pin
TMattC11-Jan-15 20:41
MemberTMattC11-Jan-15 20:41 
AnswerRe: Static constructor? Pin
V.11-Jan-15 20:52
professionalV.11-Jan-15 20:52 
GeneralRe: Static constructor? Pin
TMattC11-Jan-15 21:07
MemberTMattC11-Jan-15 21:07 
GeneralRe: Static constructor? Pin
V.11-Jan-15 21:17
professionalV.11-Jan-15 21:17 
GeneralRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:18
mveOriginalGriff11-Jan-15 21:18 
GeneralRe: Static constructor? Pin
V.11-Jan-15 21:22
professionalV.11-Jan-15 21:22 
GeneralRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:27
mveOriginalGriff11-Jan-15 21:27 
AnswerRe: Static constructor? Pin
OriginalGriff11-Jan-15 21:17
mveOriginalGriff11-Jan-15 21:17 
AnswerRe: Static constructor? Pin
Dar Brett11-Jan-15 21:27
MemberDar Brett11-Jan-15 21:27 

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.