Reputation: 18096
How to Create text file and make it's Properties Hidden and Archive and ReadOnly using C#?
Upvotes: 11
Views: 10916
Reputation: 14401
FileStream fs = File.Create("test.txt");
fs.Close();
File.SetAttributes(
"test.txt",
FileAttributes.Archive |
FileAttributes.Hidden |
FileAttributes.ReadOnly
);
Upvotes: 23