标签:io os for sp 文件 on bs app file
private bool CheckFolderWriteable(string path)
{
if (!Directory.Exists(path))
{
Directory.CreateDirectory(Server.MapPath(path));
return true;
}
try
{
string testFilePath = string.Format("{0}/test{1}{2}{3}{4}.txt", path, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);
FileStream TestFile = System.IO.File.Create(testFilePath); // 可读
TestFile.WriteByte(Convert.ToByte(true)); // 可写
TestFile.Close();
System.IO.File.Delete(testFilePath);
return true;
}
catch
{
return false;
}
}
标签:io os for sp 文件 on bs app file
原文地址:http://my.oschina.net/u/855028/blog/339025