⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx.cs

📁 工资管理系统用C#和sql开发的
💻 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 = "当前位置:系统首页";
            string MyConnectionString = ConfigurationManager.ConnectionStrings["MyPersonnelDBConnectionString"].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 + -