protected void Btn_Up_Click(object sender, EventArgs e)
{
// Specify the path on the server to
// save the uploaded file to.
// String savePath = @"D:/WebSite/FileUpload/UploadedImages/";
String savePath = @"\192.168.1.188 emp 0-T1";
// Before attempting to perform operations
// on the file, verify that the FileUpload
// control contains a file.
if (FileUpload1.HasFile)
{
// Get the name of the file to upload.
String fileName = FileUpload1.FileName;
// Append the name of the file to upload to the path.
savePath += fileName;
// Call the SaveAs method to save the
// uploaded file to the specified path.
// This example does not perform all
// the necessary error checking.
// If a file with the same name
// already exists in the specified path,
// the uploaded file overwrites it.
FileUpload1.SaveAs(savePath);
// Notify the user of the name of the file
// was saved under.
//UploadStatusLabel.Text = "Your file was saved as " + fileName;
//Response.Write("<script>alert('你的文件保存在 '" + fileName + "'!')</script>");
this.Label1.Text = "你的文件保存在 '" + savePath + "'!";
}
else
{
// Notify the user that a file was not uploaded.
//UploadStatusLabel.Text = "You did not specify a file to upload.";
ClientScriptManager scriptManager = ((Page)System.Web.HttpContext.Current.Handler).ClientScript;
scriptManager.RegisterStartupScript(typeof(string), "", "alert('你没有指定文件名上传 ');", true);
}
}
protected void Btn_Open_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(@"\192.168.1.188 emp 0-T12.xlsx");
}
catch (Exception ex)
{
//Response.Write("<script language='javascript'>alert('" + ex.Message.ToString() + "');</script>");
ClientScriptManager scriptManager = ((Page)System.Web.HttpContext.Current.Handler).ClientScript;
scriptManager.RegisterStartupScript(typeof(string), "", "alert('" + ex.Message.ToString() + "');", true);
}
}
protected void Btn_Clearn_Click(object sender, EventArgs e)
{
//获得图片的服务器路径
//string delFile = Server.MapPath("~/photo/img1.JPG");
string delFile