弗尤博客
Posted frankybpx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了弗尤博客相关的知识,希望对你有一定的参考价值。
今天实现游客和注册用户登录
1 using System.Collections.Generic; 2 using System.Linq; 3 using System.Web; 4 using System.Web.UI; 5 using System.Web.UI.WebControls; 6 using System.Data; 7 using Business; 8 using Entity; 9 public partial class Main : System.Web.UI.MasterPage 10 { 11 protected void Page_Load(object sender, EventArgs e) 12 { 13 if (Session["uid"] == null) 14 { 15 Label1.Text = "游客"; 16 lb_blogs.Text = ""; 17 lb_log.Text = "登录"; 18 lb_logoff.Text = ""; 19 lb_registe.Text = "注册"; 20 } 21 else 22 { 23 UserBusiness uname = new UserBusiness(); 24 UserEntity user = new UserEntity(); 25 user.Uid= Session["uid"].ToString(); 26 DataTable dt = new DataTable(); 27 dt = uname.FindUserInfo(user); 28 DataList1.DataSource=dt; 29 DataList1.DataBind(); 30 Label1.Text = ""; 31 lb_blogs.Text = "我的博客"; 32 lb_log.Text = ""; 33 lb_logoff.Text = "退出"; 34 lb_registe.Text = ""; 35 } 36 } 37 38 protected void lb_log_Click(object sender, EventArgs e) 39 { 40 Response.Redirect("UserLogin.aspx"); 41 } 42 }
以上是关于弗尤博客的主要内容,如果未能解决你的问题,请参考以下文章