using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; public partial class SysAdmin_DownManager : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string FileName = FileUpload2.PostedFile.FileName.ToString(); string sqlstr = " insert into ResourceInfo(ResourceName, UpLoadFilePath ,Description, UpLoadTime) values('" + this.TextBox1.Text.Trim() + "','Sysadmin/UploadResource/DownLoadResource/" + Path.GetFileName(FileName).ToString() + "' , '" + this.txtSortCN.Text + "','" + DateTime.Now.ToString() + "') "; bool b = new common().ExcuteNoneQuery(sqlstr, null); if (b) { //string FilePath = @Server.MapPath("UploadResource/DownLoadResource/" + FileName); // FileUpload2.PostedFile.SaveAs(FilePath); Methods1.Methods1.Alert(this, "增加资源成功!别忘了用ftp上传 目录是Sysadmin/UploadResource/DownLoadResource/"); } else { Methods1.Methods1.Alert(this, "增加资源失败"); } } }