string filePath = @"C:\MyFile.txt";
System.IO.FileInfo f = new System.IO.FileInfo(filePath);
f.Attributes = System.IO.FileAttributes.Hidden;
System.IO.FileInfo f = new System.IO.FileInfo(filePath);
f.Attributes = System.IO.FileAttributes.Hidden;
Console.WriteLine("You can not see the file!");
You can do a lot more things with the library System.IO.File, like copy, move, etc.
This example also works with the .Net Compact Framework
No comments:
Post a Comment