How to hide file in C#?
File.SetAttributes("pathToFile",FileAttributes.Hidden)
The previously accepted answer:
File.SetAttributes(path, FileAttributes.Hidden);
will result in certain other attributes it may have being lost, so you should:
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
FileInfo f = new FileInfo(myFileName);
f.Attributes = FileAttributes.Hidden;