using SystemIo;
string savepath=ServerMapPath("~/你要指定的文件夹");
然后用 save(savepath+"你要把它保存的文件名扩展名");
就可以了用FileUpload控件 做个死循环一直赋值上传,这样行么?
下面是fileupload上传代码
if (UploadImgPostedFileFileName != "")
{
string ImgPath = UploadImgPostedFileFileName;
ImgName = ImgPathSubstring(ImgPathLastIndexOf("\\") + 1);
string ImgExtend = ImgPathSubstring(ImgPathLastIndexOf("") + 1);
if (!(ImgExtend == "bmp" || ImgExtend == "jpg" || ImgExtend == "gif"))
{
Label1Visible = true;
ImgName = "noImagegif";
return;
}
Photo = ServerMapPath("~/Images/") + ImgName;
UploadImgPostedFileSaveAs(Photo);
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)