?? uplode.aspx.cs
字號:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class uplode : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FileUploadReport.Text = "Please Select a File to Upload!";
}
protected void Button1_Click(object sender, EventArgs e)
{
String ImgFolder = Convert.ToString(DropDownList1.SelectedItem);
String sPath;
String sFile;
if (FileUpload1.HasFile)
{
try
{
sPath = Path.Combine(Request.PhysicalApplicationPath, ImgFolder);
sFile = Path.Combine(sPath, FileUpload1.FileName);
FileUpload1.SaveAs(sFile);
FileUploadReport.Text = "Your Image Uploaded Successfully!";
Button2.EnableViewState = true;
}
catch (Exception exUpload)
{
FileUploadReport.Text = exUpload.Message;
}
}
else
{
FileUploadReport.Text = "Please Select a File to Upload!";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("myaccount.aspx");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -