asp.net 如何删除上传的图片
2008-05-28 15:06
1.Server.MapPath("/") 应用程序根目录所在的位置 如 C:/Inetpub/wwwroot/ 实例: 使用之前加上using System.IO;命名空间 string filePath = Server.MapPath("~")+"/"+"图片的路径"; if (File.Exists(filePath)) Server.MapPath("~")表示当前应用级程序的目录,如果是根目录,就是根目录,如果是虚拟目录,就是虚拟目录所在的位置 如:C:/Inetpub/wwwroot/Example/ |