How can I create or mark a file as hidden using .NET?
+10
A:
Use File.SetAttributes. "Hidden" is just one of many available attributes.
Jacob
2010-08-07 08:17:36
ThanX bro..!! one of other site gave me wrong information that- dotnet can-not hide a file.
pvaju896
2010-08-09 04:45:44
+7
A:
You set the hidden
attribute of the file.
There are several ways of doing so - with File.SetAttributes
or FileInfo.Attributes
, you simply set the FileAttributes
enumeration flag to hidden:
string path = @"c:\myfile.txt";
File.SetAttributes(path, FileAttributes.Hidden);
Oded
2010-08-07 08:22:16