using System.IO;
string directory = "UploadPhotos/"; //在服务器上创建上传图片存储的文件夹 if (!Directory.Exists(Server.MapPath(directory))) //判断存储图片的文件夹是否存在 { Directory.CreateDirectory(Server.MapPath(directory)); //如果不存在,创建它 }
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3