?? 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)
{
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyCommunityDBConnectionString"].ConnectionString;
string MySQL = "Select * From 小區(qū)信息 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["MyCommunityWebSite"] = (String)MyTable.Rows[0]["小區(qū)網(wǎng)站"].ToString();
Session["MyCommunityName"] = (String)MyTable.Rows[0]["小區(qū)名稱"];
Session["MyCommunityAddress"] = (String)MyTable.Rows[0]["小區(qū)地址"];
Session["MyCommunityPhone"] = (String)MyTable.Rows[0]["服務(wù)電話"];
Session["MyCommunityLogo"] = (String)MyTable.Rows[0]["標(biāo)志圖標(biāo)"];
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -