Click here to Skip to main content
15,911,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk323-Mar-12 11:43
turbosupramk323-Mar-12 11:43 
AnswerRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
Eddy Vluggen23-Mar-12 11:52
professionalEddy Vluggen23-Mar-12 11:52 
GeneralRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk323-Mar-12 12:38
turbosupramk323-Mar-12 12:38 
GeneralRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
Eddy Vluggen23-Mar-12 13:45
professionalEddy Vluggen23-Mar-12 13:45 
GeneralRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk323-Mar-12 18:33
turbosupramk323-Mar-12 18:33 
QuestionRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
Eddy Vluggen24-Mar-12 2:20
professionalEddy Vluggen24-Mar-12 2:20 
AnswerRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk324-Mar-12 15:14
turbosupramk324-Mar-12 15:14 
AnswerRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk326-Mar-12 6:04
turbosupramk326-Mar-12 6:04 
GeneralRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk326-Mar-12 4:58
turbosupramk326-Mar-12 4:58 
AnswerRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
Eddy Vluggen26-Mar-12 7:27
professionalEddy Vluggen26-Mar-12 7:27 
GeneralRe: Can read 64bit Reg_Sz, but not 64bit D_Word Pin
turbosupramk326-Mar-12 8:23
turbosupramk326-Mar-12 8:23 
QuestionChange the color of the mouse cursor (cross cursor) Pin
Wolfgang Kurz23-Mar-12 8:16
professionalWolfgang Kurz23-Mar-12 8:16 
AnswerRe: Change the color of the mouse cursor (cross cursor) Pin
OriginalGriff23-Mar-12 9:14
mveOriginalGriff23-Mar-12 9:14 
AnswerRe: Change the color of the mouse cursor (cross cursor) Pin
Philippe Mori23-Mar-12 12:35
Philippe Mori23-Mar-12 12:35 
GeneralRe: Change the color of the mouse cursor (cross cursor) Pin
Wolfgang Kurz23-Mar-12 23:08
professionalWolfgang Kurz23-Mar-12 23:08 
QuestionDirectoryInfo throwing ArgumentException Pin
MichCl23-Mar-12 4:53
MichCl23-Mar-12 4:53 
AnswerRe: DirectoryInfo throwing ArgumentException Pin
Wes Aday23-Mar-12 5:00
professionalWes Aday23-Mar-12 5:00 
GeneralRe: DirectoryInfo throwing ArgumentException Pin
MichCl23-Mar-12 5:25
MichCl23-Mar-12 5:25 
GeneralRe: DirectoryInfo throwing ArgumentException Pin
Wes Aday23-Mar-12 5:44
professionalWes Aday23-Mar-12 5:44 
GeneralRe: DirectoryInfo throwing ArgumentException Pin
MichCl23-Mar-12 7:46
MichCl23-Mar-12 7:46 
AnswerRe: DirectoryInfo throwing ArgumentException Pin
fjdiewornncalwe23-Mar-12 7:09
professionalfjdiewornncalwe23-Mar-12 7:09 
GeneralRe: DirectoryInfo throwing ArgumentException Pin
MichCl23-Mar-12 8:24
MichCl23-Mar-12 8:24 
GeneralRe: DirectoryInfo throwing ArgumentException Pin
fjdiewornncalwe23-Mar-12 9:12
professionalfjdiewornncalwe23-Mar-12 9:12 
AnswerRe: DirectoryInfo throwing ArgumentException Pin
Alan N23-Mar-12 7:32
Alan N23-Mar-12 7:32 
MichCl wrote:
Any ideas what the problem could be?

The short answer is poor documentation, i.e. not mentioned on MSDN.

The constructor will reject bad paths and if there is the potential for a problem I think the only solution is to do some validation on the argument. Directory.Exists must be the method of choice here as it seems to be quite resilient and returns false for paths which would cause DirectoryInfo to throw.

Bad paths may result from:

Illegal characters (this one is documented)
C#
new DirectoryInfo(@"*");
// System.ArgumentException: Illegal characters in path.

Path format not supported. This has it's own undocumented exception which caught me out, once! Why this isn't reported as an ArgumentException is beyond me.
C#
di = new DirectoryInfo(@"\c:\");
// System.NotSupportedException: The given path's format is not supported.

and the one you've found
C#
di = new DirectoryInfo(@"");
// System.ArgumentException: The path is not of a legal form.


Alan.
GeneralRe: DirectoryInfo throwing ArgumentException Pin
MichCl23-Mar-12 7:47
MichCl23-Mar-12 7:47 

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.