开发者

Create text file and make it hidden and readOnly c#

开发者 https://www.devze.com 2023-01-13 02:39 出处:网络
How to Create tex开发者_开发技巧t file and make it\'s Properties Hidden and Archive and ReadOnly using C#?FileStream fs = File.Create(\"test.txt\");

How to Create tex开发者_开发技巧t file and make it's Properties Hidden and Archive and ReadOnly using C#?


FileStream fs = File.Create("test.txt");
fs.Close();
File.SetAttributes(
   "test.txt", 
   FileAttributes.Archive | 
   FileAttributes.Hidden | 
   FileAttributes.ReadOnly
   );
0

精彩评论

暂无评论...
验证码 换一张
取 消