判断是否有文件存在
2005-05-02 21:36
393 查看
using System.IO;
if(File.Exists(Server.MapPath(路径)))//返回BOOL值
{
}
//下面是怡然居网站中的代码xsfyxx.aspx184行
string strpicsw="uploadpic/"+lbno.Text+"a.jpg";
string strpichx="uploadpic/"+lbno.Text+"a.jpg";
if(File.Exists(Server.MapPath(strpicsw))!=false || File.Exists(Server.MapPath(strpichx))!=false)
{
if(File.Exists(Server.MapPath(strpicsw)))
{
Label1.Text="<a href='uploadpic/"+lbno.Text+"a.jpg' target='_blank'>查看实物图</a>";
}
if(File.Exists(Server.MapPath(strpichx)))
{
Label2.Text="<a href='uploadpic/"+lbno.Text+"b.jpg' target='_blank'>查看户型图</a>";
}
}
if(File.Exists(Server.MapPath(路径)))//返回BOOL值
{
}
//下面是怡然居网站中的代码xsfyxx.aspx184行
string strpicsw="uploadpic/"+lbno.Text+"a.jpg";
string strpichx="uploadpic/"+lbno.Text+"a.jpg";
if(File.Exists(Server.MapPath(strpicsw))!=false || File.Exists(Server.MapPath(strpichx))!=false)
{
if(File.Exists(Server.MapPath(strpicsw)))
{
Label1.Text="<a href='uploadpic/"+lbno.Text+"a.jpg' target='_blank'>查看实物图</a>";
}
if(File.Exists(Server.MapPath(strpichx)))
{
Label2.Text="<a href='uploadpic/"+lbno.Text+"b.jpg' target='_blank'>查看户型图</a>";
}
}
相关文章推荐
- ASP_判断文件是否存在
- 判断远程网络上的文件是否存在
- VBA判断指定的文件夹或文件是否存在
- 在各种WorkSpace中判断要打开的文件(如:栅格,要素)是否存在
- shell判断文件,目录是否存在或者具有权限
- linux下python脚本判断目录和文件是否存在
- [IO]判断文件或者目录是否存在
- _access判断文件是否存在
- python判断文件是否存在
- C#判断远程文件是否存在
- ios--文件创建,删除,判断某个文件是否存在
- VB 判断文件是否存在
- 判断文件是否存在 - sh
- C语言判断文件夹或者文件是否存在的方法
- Java 判断文件夹、文件是否存在、否则创建文件夹
- linux下c调用shell命令,以及判断文件是否存在
- 判断远程文件是否存在
- Java 判断文件夹、文件是否存在、否则创建文件夹
- ASP.NET对文件的操作,创建文件,判断文件是否存在,判断文件是否存在删除文件夹
- jsp url文件判断是否存在