Hi
I am making my first steps with C# and I don´t have much programming
experience so this might be trivial.
Here is the code:
class Program
{
static void Main(string[] args)
{
DirectoryInfo myDir = new DirectoryInfo("c:\\mydir");
if ((myDir.Exists)) {
myDir.Delete();
}
Console.WriteLine(myDir.Exists);
Console.ReadLine();
}
}
I tried this both with deleting and creating the directory. What
happens is that when the if clause gets executed (directory exists so
it is than deleted), the myDir.Exists property is not updated (it will
still hold true even if the directory was deleted in the line above).
Is this the way it is supposed to work?
Thanks Ahead
Oren