由于需要图片上传的功能,所以花了一些时间网上找相关资料终于搞定,效果图如下:
下面的是解决方案截图和上传的图片截图:
下面是代码:
1.界面代码


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadPic.aspx.cs" Inherits="Pic_Try.UploadPic" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>图片上传和显示</title> <style type="text/css"> .pic_text{ color:Red;} .pic_label { color:Gray; margin-top:5px; margin-bottom:5px;} .pic_image { margin:5px;} </style> </head> <body> <form id="form1" runat="server"> <div class="pic_image"><asp:Image ID="pic" runat="server" /></div> <div><asp:FileUpload ID="pic_upload" runat="server" /><asp:Label ID=