c#中如何做一个图片导入按钮
c#中如何做一个图片导入按钮,哪位大哥吧我用代码写一下111111111
1 图 1
1 片 1
1 1
---------
-----------
1 导入按钮 1
----------- --------------------编程问答-------------------- 没有看明白
路过 --------------------编程问答-------------------- 没懂
要导入文件不是有现成的控件吗 --------------------编程问答-------------------- fileupload 上传图片
或使用rar等压缩文件上传文件到文件夹再解压 --------------------编程问答-------------------- 放一个HtmlInputFile
HttpFileCollection files = HttpContext.Current.Request.Files;
if ( files.Count == 1 )
{
HttpPostedFile postedFile = files[0];
if ( postedFile.FileName != "" )
{
string fileName = Path.GetExtension(postedFile.FileName);
string savePath = "/upload/" + fileName;
try
{
postedFile.SaveAs(savePath);
}
catch
{
this.ShowMessage("上传照片失败!");
throw;
}
}
}
补充:.NET技术 , C#