日期:2014-05-17 浏览次数:20583 次
<div>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</div>
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.HasFile)
{
string file = this.FileUpload1.PostedFile.FileName;
Response.Write("<script>alert('" + file + "')</script>");
}
}