111,125
社区成员
发帖
与我相关
我的任务
分享string path = Server.MapPath("js/123.js");
if(File.Exists(path))
{
File.Delete(path);
}
StreamWriter sw = File.CreateText(path);
Random rd = new Random();
sw.WriteLine(rd.Next().ToString().Trim());
sw.Close();
void AddFullControl(string filename) {
FileSecurity fs = File.GetAccessControl(filename);
fs.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.FullControl, AccessControlType.Allow));
File.SetAccessControl(filename, fs);
}