日期:2014-05-19  浏览次数:20368 次

判断文件是否存在
写了一个数据备份的模块,在备份在判断此文件是否存在。如何处理?谢谢,小弟新手

------解决方案--------------------
System.IO.File.Exists(filepath + filename);
{
存在
}
else
{
不存在
}

------解决方案--------------------
if (!System.IO.File.Exists( "路径+文件名 "))
{
Response.Write( " <script language= 'javascript '> alert( '对不起,文件不存在! '); </script> ");
return;
}
------解决方案--------------------
File.Exists(your filename);
{
Exists
}
else
{
not Exists
}

------解决方案--------------------
System.IO.File.Exists(filepath + filename);
{
存在
}
else
{
不存在
}