asp.net(C#)判断指定的文件是否存在的代码
时间:2019-02-22 11:18:29
收藏:0
阅读:197
研发过程中,将做工程过程比较常用的一些代码段备份一下,下边代码段是关于asp.net(C#)判断指定的文件是否存在的代码,应该对各位有用处。
if(!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
}
if(!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
}
原文:https://blog.51cto.com/14131177/2353269
评论(0)