sto*_*roz 51
接受的答案是:
File.SetAttributes(path, FileAttributes.Hidden);
Run Code Online (Sandbox Code Playgroud)
会导致某些其他属性丢失,所以你应该:
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
Run Code Online (Sandbox Code Playgroud)
Raj*_*sh 33
File.SetAttributes("pathToFile",FileAttributes.Hidden)
Run Code Online (Sandbox Code Playgroud)
FileInfo f = new FileInfo(myFileName);
f.Attributes = FileAttributes.Hidden;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26631 次 |
| 最近记录: |