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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top