📄 manageraddfile.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;
public partial class Manager_ManagerAddFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
tbName.Text = "";
lbMessage.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
FileManage Myfile = new FileManage();
string fileName = tbName.Text;
string fileAddress = FileAddress.PostedFile.FileName;
string path = "", savePath = "", filename, Timestr;
if (fileAddress != "")
{
filename = fileAddress.Substring(fileAddress.LastIndexOf("\\") + 1);
Timestr = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
Timestr = Timestr + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Millisecond.ToString();
savePath = savePath + Server.MapPath(Request.ApplicationPath) + "/File/" + filename;//
FileAddress.PostedFile.SaveAs(savePath);
path = "/File/" + Timestr + filename;
}
int userID = int.Parse(Session["Userid"].ToString());
int departId = int.Parse(Session["DepartId"].ToString());
string Ftype;
Ftype = rbtnFileType.SelectedItem.Value.ToString();
Myfile.CommentAddFile(fileName, path, userID, 2, departId, Ftype);
lbMessage.Text = "添加成功!";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -