?? default.aspx.cs
字號:
?//文件名:Default.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;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Page.Title = "當前位置:系統首頁";
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyHotelDBConnectionString"].ConnectionString;
string MySQL = "Select * From 酒店信息 Where 優先級=1";
SqlConnection MyConnection = new SqlConnection(MyConnectionString);
MyConnection.Open();
DataTable MyTable = new DataTable();
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyTable);
this.Image1.ImageUrl = "~/Images/" + (String)MyTable.Rows[0]["首頁圖像"];
Session["MySystemName"]=(String)MyTable.Rows[0]["系統名稱"];
Session["MyCompanyWebSite"]=(String)MyTable.Rows[0]["酒店網站"].ToString();
Session["MyCompanyName"] = (String)MyTable.Rows[0]["酒店名稱"];
Session["MyCompanyAddress"]=(String)MyTable.Rows[0]["酒店地址"];
Session["MyCompanyPhone"]=(String)MyTable.Rows[0]["服務電話"];
Session["MyCompanyLogo"] = (String)MyTable.Rows[0]["標志圖標"];
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -