protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["user_id"] != null) { if (Request.Cookies["user_id"].Value.ToString() != "") { pm p = new pm(); string newpm = p.getnewpm(Request.Cookies["user_id"].Value.ToString()); if (newpm == "0") { Literal1.Text = ""; } else { Literal1.Text = "| 您共有<a href=\"/member/pm.aspx\" class=\"red_2\">" + newpm + "</a>条未读留言"; } if (Request.Cookies["realname"] != null) { Label8.Text = "<span style=\"color:#000000;\">欢迎您!" + Server.UrlDecode(Request.Cookies["realname"].Value.ToString()) + "</span> " + "<a href=\"/accounts/logout.aspx\">[退出登录]</a><script src='/home/newlogin.php'></script>"; } } else { Label8.Text = "欢迎您!<a href=\"/accounts/login.aspx\">[登录]</a><script src='/home/newlogout.php'></script>"; } } else { Label8.Text = "欢迎您!<a href=\"/accounts/login.aspx\">[登录]</a><script src='/home/newlogout.php'></script>"; } //data_conn cn = new data_conn(); //DataSet ds = new DataSet(); //string sql; //sql = "SELECT TOP 30 "; //sql = sql + "* "; //sql = sql + "FROM "; //sql = sql + "TB_NEWYEARMERRY2011 "; //sql = sql + "ORDER BY nid DESC "; //ds = cn.mdb_ds(sql, "zhufu"); //Rptzhufu.DataSource = ds.Tables["zhufu"].DefaultView; //Rptzhufu.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["user_id"] != null) { if (Request.Cookies["user_id"].Value.ToString() != "") { pm p = new pm(); string newpm = p.getnewpm(Request.Cookies["user_id"].Value.ToString()); if (newpm == "0") { Literal1.Text = "0"; } else { Literal1.Text = newpm; } if (Request.Cookies["realname"] != null) { Literal2.Text = "欢迎您!" + Server.UrlDecode(Request.Cookies["realname"].Value.ToString()) + " <a href=\"/accounts/logout.aspx\">退出登录</a>"; } homelogin.Visible = true; homelogout.Visible = false; } else { PlaceHolder1.Visible = false; Literal2.Text = "<a href=\"/accounts/login.aspx\"><img src=\"/images/fcl/jt.gif\" border=\"0\" />登录</a>"; homelogin.Visible = false; homelogout.Visible = true; } } else { PlaceHolder1.Visible = false; Literal2.Text = "<a href=\"/accounts/login.aspx\"><img src=\"/images/fcl/jt.gif\" border=\"0\" />登录</a>"; homelogin.Visible = false; homelogout.Visible = true; } }
protected void getpm() { try { pm p = new pm(); string newpm = p.getnewpm(Request.Cookies["user_id"].Value.ToString()); if (newpm == "0") { Label2.Text = "<a href=\"/member/pm.aspx?filter=new\" target=\"_blank\"> 您没有新留言</a>"; } else { Label2.Text = "<a href=\"/member/pm.aspx?filter=new\" target=\"_blank\">您有<b style=\"color:red\">" + newpm + "</b>条新留言</a>"; } } catch { Label2.Text = " 网络有错误"; } }
public void checklogin() { //如果用户登陆信息正确,显示用户信息窗口及用户名 if (this.Request.Cookies["user_id"] == null) { PlaceHolder2.Visible = false; PlaceHolder1.Visible = true; } else { data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = ""; sql = sql + "SELECT "; sql = sql + "Userpassword, "; sql = sql + "Realname "; sql = sql + "FROM "; sql = sql + "TB_User "; sql = sql + "WHERE "; sql = sql + "UserID = '" + this.Request.Cookies["user_id"].Value.ToString() + "' "; ds = cn.mdb_ds(sql, "user"); if (ds.Tables["user"].Rows.Count > 0) { Response.Cookies["user_password"].Value = ds.Tables["user"].Rows[0][0].ToString(); } if (this.Request.Cookies["user_id"].Value == "") { PlaceHolder2.Visible = false; PlaceHolder1.Visible = true; } else { loginTime(); PlaceHolder2.Visible = true; PlaceHolder1.Visible = false; if (ds.Tables["user"].Rows.Count > 0) { Label1.Text = Server.UrlDecode(ds.Tables["user"].Rows[0]["realname"].ToString()); check ck = new check(); pm p = new pm(); string newpm = p.getnewpm(ck.CheckNumber(Request.Cookies["user_id"].Value.ToString())); ltrLiuyan.Text = newpm; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["user_id"] != null) { if (Request.Cookies["user_id"].Value.ToString() != "") { pm p = new pm(); string newpm = p.getnewpm(Request.Cookies["user_id"].Value.ToString()); if (newpm == "0") { Literal1.Text = "0"; } else { Literal1.Text = newpm; } if (Request.Cookies["realname"] != null) { Literal2.Text = "欢迎您!" + Server.UrlDecode(Request.Cookies["realname"].Value.ToString()) + " <a href=\"/accounts/logout.aspx\">退出登录</a>"; } homelogin.Visible = true; homelogout.Visible = false; } else { PlaceHolder1.Visible = false; PlaceHolder2.Visible = true; Literal2.Text = "<a href=\"/accounts/login.aspx\"><img src=\"/images/fcl/jt.gif\" border=\"0\" width=\"3\" height=\"5\" />登录</a>"; homelogin.Visible = false; homelogout.Visible = true; } } else { PlaceHolder1.Visible = false; PlaceHolder2.Visible = true; Literal2.Text = "<a href=\"/accounts/login.aspx\"><img src=\"/images/fcl/jt.gif\" border=\"0\" width=\"3\" height=\"5\" />登录</a>"; homelogin.Visible = false; homelogout.Visible = true; } GetRequest GetRequest1 = new GetRequest(); string uvid = "0"; if (GetRequest1.GetRequestCookies("uvid", "0") == "0") { data_conn cn = new data_conn(); DataSet ds = new DataSet(); string sql = "INSERT INTO TB_UV_LIST (uvtime) values (getdate());select @@identity"; ds = cn.mdb_ds(sql, "uvid"); uvid = ds.Tables["uvid"].Rows[0][0].ToString(); Response.Cookies["uvid"].Value = uvid; Response.Cookies["uvid"].Expires = DateTime.Now.AddDays(365); } else { uvid = GetRequest1.GetRequestCookies("uvid", "0"); } string srvlink = ""; srvlink += "<a title=\"欢迎使用在线客服\" id=\"service_link\" href=\"http://im.cn.alisoft.com/webim/webim/webclient!open.jspa?lang=zh_cn&img=0&memberid="; srvlink += "e" + uvid; srvlink += "&targetid=cnalichna910254766&siteId=4035516&initiative=1&domain=probe.alisoft.com&siteFlag=enet&colorStyle=orange&msg=&ct=\" target=\"_blank\">在线客服</a>"; Literal3.Text = srvlink; }