?? default.aspx.cs
字號:
?using System;
using System.Data;
using System.Configuration;
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 = "當前位置:系統(tǒng)首頁";
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyBooksDBConnectionString"].ConnectionString;
string MySQL = "Select * From 公司信息 Where 優(yōu)先級=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]["系統(tǒng)名稱"];
Session["MyCompanyWebSite"] = (String)MyTable.Rows[0]["公司網(wǎng)站"].ToString();
Session["MyCompanyName"] = (String)MyTable.Rows[0]["公司名稱"];
Session["MyCompanyAddress"] = (String)MyTable.Rows[0]["公司地址"];
Session["MyCompanyPhone"] = (String)MyTable.Rows[0]["服務(wù)電話"];
Session["MyCompanyLogo"] = (String)MyTable.Rows[0]["標志圖標"];
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -