在winform程序里删除上传的图片,用下面的代码出现这个错误 “不支持给定路径的格式。”
string pic = "http://192.168.12.160:8001/BoleWeb/UpLoadFiles/KF/" + kf.PIC;
System.IO.FileInfo file = new System.IO.FileInfo(Application.StartupPath + pic);
if (file.Exists)
{
file.Delete();
}
这是怎么回事,是不是用这个方法删除???
string pic = "http://192.168.12.160:8001/BoleWeb/UpLoadFiles/KF/" + kf.PIC;
System.IO.FileInfo file = new System.IO.FileInfo(Application.StartupPath + pic);
if (file.Exists)
{
file.Delete();
}
这是怎么回事,是不是用这个方法删除???
解决方案 »
- 数据库中如何实现where条件中能使用字符串
- 访问Oracle9i的程序问题
- 请问在webservice中,如何调用一个外部程序,并等待此外部程序关闭后才执行下一行代码(如用API和c#如何实现)?谢谢!
- Remoting /Com+的事务处理心得(共享)
- office 插件问题
- 怎么让一行文字信息从容器的一边移动到另一边!
- 关于_dopostback函数
- 菜鸟问题,谁都答得上!!
- 网络安全策略终极评估(以Web系统描述)
- 急:ADO.NET下使用一个活动连接执行多个查询时的游标问题(Oracle)
- C#导出excel问题
- C# 添加web引用,总是弹出“Discovery Credential for Proxy Server”
if (File.Exists(Server.MapPath("~/Softwares/") + data.DownLoadTag + ".rar"))
File.Delete(Server.MapPath("~/Softwares/") + data.DownLoadTag + ".rar");
File.Delete(@"\\192.168.1.2\Inetpub\wwwroot\1.txt")
FtpWebRequest
if (File.Exists(Server.MapPath("~/Softwares/") + data.DownLoadTag + ".rar"))
File.Delete(Server.MapPath("~/Softwares/") + data.DownLoadTag + ".rar");