1 <%@ Page
Language="C#"AutoEventWireup="true"CodeFile="uple.aspx.cs"Inherits="up
le_uple"%>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title>无标题页</title>
8 </head>
9 <body>
10 <form id="form1"runat="server">
11 <div>
12 <asp:FileUpload ID="FileUpload1"runat="server"/>
13 <asp:Button
ID="Button1"runat="server"OnClick="Button1_Click"Text="上传"/><br />
14 <asp:Label ID="Label1"runat="server"></asp:Label></div>
15 </form>
16 </body>
17 </html>
1 usingSystem;
2 usingSystem.Data;
3 usingSystem.Conguration;
4 usingSystem.Collections;
5 usingSystem.Web;
6 usingSystem.Web.Security;
7 usingSystem.Web.UI;
8 usingSystem.Web.UI.WebControls;
9 usingSystem.Web.UI.WebControls.WebParts;
10 usingSystem.Web.UI.HtmlControls;
11 usingSystem.IO;
12
13 publicpartialclassuple_uple : System.Web.UI.Page
14 {
15 protectedvoidPage_Load(objectsender, EventArgs e)
16 { }
17
18 protectedvoidButton1_Click(objectsender, EventArgs e)
19 {
20 if(FileUpload1.HasFile)
21 {
评论1