?? 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 + -