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
 
Back
Top