日期:2014-05-18  浏览次数:20395 次

一个通过浏览上传图片的问题,请高手指导
我想通过两个button,一个“浏览”,一个是“上传”,实现选中一个图片,通过上传显示在页面上,如何实现,请高手指教,不胜感激

------解决方案--------------------
HTML code
  <asp:FileUpload ID="FileUpload1" runat="server" />&nbsp;
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="上传" Width="47px" />
        <asp:Image ID="Image1" runat="server" Visible="false" /></div>

------解决方案--------------------

一搜一大把
http://www.cnblogs.com/outman2008/archive/2006/01/07/312823.html
http://www.cnblogs.com/overred/archive/2006/05/06/392881.html
http://pw.cnblogs.com/archive/2006/05/24/408427.html
http://dev.yesky.com/msdn/304/2413804.shtml
http://dotnet.aspx.cc/article/58ea3515-36f2-4fd9-ac89-eaf49f59816c/read.aspx(孟子)
http://blog.joycode.com/saucer/posts/16225.aspx
------解决方案--------------------
探讨
HTML code <asp:FileUpload ID="FileUpload1" runat="server" />&nbsp;
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="上传" Width="47px" />
<asp:Image ID="Image1" runat="server" Visible="false" /></div>





C# code protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.PostedFile.ContentLength == 0) retur…

------解决方案--------------------
探讨
好,收下了,多谢各位