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

📄 userwelcome.ascx.cs

📁 visual stdio 2005
💻 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.Web.Services;
using System.Data.OleDb;


public partial class UserWelcome : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Session ["name"]!=null )
        this.Label1.Text = Session["name"].ToString();
        /*
        //Response.Write("<script>alert('欢迎加载!')</script>");
        OleDbConnection cnA = new OleDbConnection();
        cnA.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=" + Server.MapPath("BDB/BookStore.mdb");
        string cmdtext = "SELECT username,userstate FROM userinfo ";
        OleDbCommand cmA = new OleDbCommand(cmdtext, cnA);
        cnA.Open();
        OleDbDataReader dr = cmA.ExecuteReader();
        if (dr == null)
        {
            cnA.Close();
        }
        while (dr.Read())
        {
            if (dr.GetValue(1).ToString() == "1")
            {
                this.Visible = true;

                this.Label1.Text = dr.GetValue(0).ToString();
            }
            //Response.Write("<script>alert('欢迎shibai')</script>");
        }
        cnA.Close();
            
        
       
       // string strspl = "Select username from userinfo where userid='" + Session["UserID"].ToString() + "';";
        //DataTable dttable = WebService.ExcuteSelect(strspl);
        //this.Label1.Text = dttable.Rows[0]["username"].ToString();
         */

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -