DirectoryInfo BUG 2

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

xucheng

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

if (!(di.Exists)){
di.Create();
}
if (!(di.Exists)){
Console.Write("BUG Report");
}
 
DirectoryInfo di=new DirectoryInfo("\\abcde");

if (!(di.Exists)){
di.Create();
di.Refresh();
}
if (!(di.Exists)){
Console.Write("BUG Report");
}
 
I'm not sure what the problem is, but you may want to try using the Static
instance of it...Directory.Exists, Directory.CreateDirectory ..If you aren't
doing anything else with the object, you don't need to initialize an
instance of the class and It'll definitely work for you.

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