DirectoryInfo BUG

  • Thread starter Thread starter xucheng
  • Start date Start date
X

xucheng

DirectoryInfo di=new DirectoryInfo("\abcd");

if (!(di.Exists)){
di.Create();
}


throw ArgumentException

After di.Exists execute , di content have been changed .
 
Which is causing the problem, the if line or the Create?

If it's the if line then
You can use just Directory.Exists(@"\abcd");

I'm wondering however if the escape character isn't the problem. Maybe you
want to use the @ symbol first.

HTH,

Bill
 
Back
Top