コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         u = Session["user"] as Dollers.model.User;
         if (!u.room_name.Equals(""))
             Response.Redirect("room.aspx");
     }
     else
     {
         Response.Redirect("login.aspx");
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         u = Session["user"] as Dollers.model.User;
         if (!u.room_ID.Equals(""))
             Response.Redirect("room.aspx");
         room_list = Application["room_list"] as List<string>;
         room_Repeater.DataSource = room_list;
         room_Repeater.DataBind();
         username.Text = u.name;
         profile.ImageUrl = u.profile;
         count.Text = Application["count"].ToString();
     }
     else
     {
         Response.Redirect("login.aspx");
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         last_message = DateTime.Now;
         u = Session["user"] as Dollers.model.User;
         name.Text = u.name;
         if (u.room_name == "" && Request.QueryString["room"] != null && !Request.QueryString["room"].Equals(""))
         {
             u.room_name = Request.QueryString["room"];
             Session["user"] = u;
             Application.Lock();
             r = Application[u.room_name] as Dollers.model.Room;
             if (r.count >= r.max_count)
             {
                 Response.Redirect("list.aspx");
             }
             r.addNewMessage(new Dollers.model.Message(false, "进入房间", u));
             r.count++;
             last_message = DateTime.Now;
             Application[u.room_name] = r;
             Application.UnLock();
         }
         if (Application[u.room_name] == null)
             Response.Redirect("list.aspx");
         Application.Lock();
         Application[u.room_name + "_flag"] = DateTime.Now;
         Application.UnLock();
         messagesDand();
     }
     else
     {
         Response.Redirect("login.aspx");
     }
     now = DateTime.Now;
 }