(C#)请问如何从页面上接受浏览者上传文件? ASP.NET上传文件的实例 http://www.chinabs.net/aspnet/default.asp?infoid=73 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //upload.aspx<input type="file" id="fileUpload" runat="server" />//upload.aspx.csHttpPostedFile pFile = fileUpload.PostedFile;string filePath = ""; //文件保存的绝对路径pFile.SaveAs(filePath); http://xml.sz.luohuedu.net/xml/Content.asp http://expert.csdn.net/Expert/topic/2423/2423695.xml?temp=.6251642其中上传图片就是上传文件的做法 先在html页里加入<input id="UpLoadFile" type="file" runat="server">然后private void Button1_click(){string pic;pic="xxx";//路径UpLoadFile.PostedFile.SaveAs(Server.MapPath(pic));Image1.ImageUrl="pic";Image1.Visible=true;} 页面访问问题? 经验丰富的进来指点指点 Enterprise Library如何入门 如何实现在跳转页面之前看见弹出警告框? 请教一个IIS的问题 怎样将个人PC配置成服务器,使用ASP.NET 使用asp.net制作的视频预览程序,用户要求不通过共享访问,有什么方式解决呢? 有关标签定位! formview inserting时如何控制控件的值 奇怪的问题:"&"变成了"&",请指点!!! 如何判断TEXTBOX中只能是FLOAT类型?? 导出EXCEL出错,奇怪啊,高分酬谢! 今天生日,可惜刚拔了牙,好疼,什么也不能吃:(
<input type="file" id="fileUpload" runat="server" />//upload.aspx.cs
HttpPostedFile pFile = fileUpload.PostedFile;
string filePath = ""; //文件保存的绝对路径
pFile.SaveAs(filePath);
然后
private void Button1_click()
{string pic;
pic="xxx";//路径
UpLoadFile.PostedFile.SaveAs(Server.MapPath(pic));
Image1.ImageUrl="pic";
Image1.Visible=true;
}