📄 download.aspx.cs
字号:
using System;
using System.Data.SqlClient;
namespace qminoa.Webs
{
public class Download : qminoa.Webs.PageBase
{
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
this.PageBegin("文档管理",true);
SqlDataReader dr;
int FileIndex=Convert.ToInt32(Request.QueryString["fid"],10);
string con=System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection conn=new SqlConnection(con);
SqlCommand command = new SqlCommand("Select FPath from fmfilecont where fileId=@fileId",conn);
command.Parameters.Add("@fileId",FileIndex);
conn.Open();
dr=command.ExecuteReader();
dr.Read();
Response.ClearHeaders();
string path=dr["FPath"].ToString();
string[] http=path.Split('\\');
string realpath=http[1]+"/"+http[2];
Response.Redirect(realpath);
dr.Close();
conn.Close();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -