コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((base.Request.QueryString["openid"] != null) && (base.Request.QueryString["openid"] != ""))
     {
         this.openid = base.Request.QueryString["openid"];
     }
     if ((base.Request.QueryString["openkey"] != null) && (base.Request.QueryString["openkey"] != ""))
     {
         this.openkey = base.Request.QueryString["openkey"];
     }
     if ((base.Request.QueryString["name"] != null) && (base.Request.QueryString["name"] != ""))
     {
         this.wb_name = base.Request.QueryString["name"];
     }
     if ((base.Request.QueryString["oauth2atoken"] != null) && (base.Request.QueryString["oauth2atoken"] != ""))
     {
         try
         {
             string[] strArray = base.Request.QueryString["oauth2atoken"].Split(new char[] { '&' });
             this.oauth2token = strArray[0].Split(new char[] { '=' })[0];
             this.expire      = DateTime.Now.AddSeconds((double)int.Parse(strArray[1].Split(new char[] { '=' })[1]));
         }
         catch
         {
         }
     }
     if ((base.Request.QueryString["nick"] != null) && (base.Request.QueryString["nick"] != ""))
     {
         this.wb_nick = base.Request.QueryString["nick"];
     }
     if (!base.IsPostBack)
     {
         Dictionary <string, string> dictionary = new Dictionary <string, string>();
         for (int i = 0; i <= 0x17; i++)
         {
             dictionary.Add(i.ToString(), i.ToString());
         }
         this.ddlHour.DataSource     = dictionary;
         this.ddlHour.DataTextField  = "Key";
         this.ddlHour.DataValueField = "Value";
         this.ddlHour.DataBind();
         this.ddlHour.SelectedIndex = 12;
         QQWeiBo bo = new QQWeiBo();
         if (this.openid != "")
         {
             QQWeiBoUserMod recordByName = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name);
             if (recordByName.SysNo <= 0)
             {
                 string[] strArray2 = bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus).Split(new char[] { '|' });
                 recordByName.Oauth2Token = this.oauth2token;
                 recordByName.OpenId      = this.openid;
                 recordByName.TS          = DateTime.Now;
                 recordByName.WB_Name     = this.wb_name;
                 recordByName.WB_Nick     = this.wb_nick;
                 recordByName.Location    = strArray2[2];
                 recordByName.FansNum     = int.Parse(strArray2[3]);
                 recordByName.IsVIP       = int.Parse(strArray2[4]);
                 QQWeiBoUserBll.GetInstance().Add(recordByName);
             }
             else if ((recordByName.WB_Name == "") || (recordByName.FansNum == -999999))
             {
                 string[] strArray3 = bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus).Split(new char[] { '|' });
                 recordByName.WB_Name  = this.wb_name;
                 recordByName.WB_Nick  = this.wb_nick;
                 recordByName.Location = strArray3[2];
                 recordByName.FansNum  = int.Parse(strArray3[3]);
                 recordByName.IsVIP    = int.Parse(strArray3[4]);
                 QQWeiBoUserBll.GetInstance().Update(recordByName);
             }
         }
         if (bo.CheckFriend(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.venus))
         {
             this.nofriend1.Style["display"] = "none";
             this.nofriend2.Style["display"] = "none";
         }
         else
         {
             this.isfriend1.Style["display"] = "none";
             this.isfriend2.Style["display"] = "none";
         }
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((base.Request.QueryString["openid"] != null) && (base.Request.QueryString["openid"] != ""))
     {
         this.openid = base.Request.QueryString["openid"];
     }
     if ((base.Request.QueryString["openkey"] != null) && (base.Request.QueryString["openkey"] != ""))
     {
         this.openkey = base.Request.QueryString["openkey"];
     }
     if ((base.Request.QueryString["name"] != null) && (base.Request.QueryString["name"] != ""))
     {
         this.wb_name = base.Request.QueryString["name"];
     }
     if ((base.Request.QueryString["oauth2atoken"] != null) && (base.Request.QueryString["oauth2atoken"] != ""))
     {
         try
         {
             string[] strArray = base.Request.QueryString["oauth2atoken"].Split(new char[] { '&' });
             this.oauth2token = strArray[0].Split(new char[] { '=' })[0];
             this.expire      = DateTime.Now.AddSeconds((double)int.Parse(strArray[1].Split(new char[] { '=' })[1]));
         }
         catch
         {
         }
     }
     if ((base.Request.QueryString["nick"] != null) && (base.Request.QueryString["nick"] != ""))
     {
         this.wb_nick = base.Request.QueryString["nick"];
     }
     if (!base.IsPostBack)
     {
         this.MultiView1.ActiveViewIndex = 0;
         QQWeiBo        bo           = new QQWeiBo();
         QQWeiBoUserMod recordByName = QQWeiBoUserBll.GetInstance().GetRecordByName(this.wb_name);
         if (this.openid != "")
         {
             if (recordByName.SysNo <= 0)
             {
                 string[] strArray2 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 recordByName.Oauth2Token1 = this.oauth2token;
                 recordByName.OpenId1      = this.openid;
                 recordByName.Expire1      = this.expire;
                 recordByName.WB_Name      = this.wb_name;
                 recordByName.WB_Nick      = this.wb_nick;
                 recordByName.TS           = DateTime.Now;
                 recordByName.Location     = strArray2[2];
                 recordByName.FansNum      = int.Parse(strArray2[3]);
                 recordByName.IsVIP        = int.Parse(strArray2[4]);
                 QQWeiBoUserBll.GetInstance().Add(recordByName);
                 this.ViewState["userpara"] = strArray2;
             }
             else if ((recordByName.WB_Name == "") || (recordByName.FansNum == -999999))
             {
                 string[] strArray3 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 recordByName.Oauth2Token1 = this.oauth2token;
                 recordByName.OpenId1      = this.openid;
                 recordByName.Expire1      = this.expire;
                 recordByName.WB_Name      = this.wb_name;
                 recordByName.WB_Nick      = this.wb_nick;
                 recordByName.Location     = strArray3[2];
                 recordByName.FansNum      = int.Parse(strArray3[3]);
                 recordByName.IsVIP        = int.Parse(strArray3[4]);
                 QQWeiBoUserBll.GetInstance().Update(recordByName);
                 this.ViewState["userpara"] = strArray3;
             }
             else
             {
                 string[] strArray4 = (this.oauth2token == "") ? bo.GetUserSimpleInfo(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice).Split(new char[] { '|' }) : bo.GetUserSimpleInfo(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true).Split(new char[] { '|' });
                 this.ViewState["userpara"] = strArray4;
             }
         }
         this.ViewState["weibouser"] = recordByName;
         if ((this.oauth2token == "") ? bo.CheckFriend(this.openid, this.openkey, base.Request.UserHostAddress, AppEnum.Apps.astrodice) : bo.CheckFriend(this.openid, this.oauth2token, base.Request.UserHostAddress, AppEnum.Apps.astrodice, true))
         {
             this.nofriend1.Style["display"] = "none";
         }
         else
         {
             this.isfriend1.Style["display"] = "none";
         }
         this.LinkButton8.Style["display"]  = "none";
         this.LinkButton9.Style["display"]  = "none";
         this.LinkButton10.Style["display"] = "none";
         this.Label1.Text = "<p><b>提问说明:</b><br />★一定要是你很诚心很想知道的事。问题可以是具体的小事,如今天晚上吃什么;也可以是别人的是,某某明星是不是真的有外遇。<br />\r\n                                  ★不要在短时间内重复问一个问题,除非事态已经有了新的变化。<br />\r\n                                  ★问Whether不如问How,骰子不会简单回答Yes或No。如果问“我该跳槽么?”不如问“如果换工作的话前景如何?”</p>\r\n                                 <p><b>特别提示:</b><br />★占星骰子需消耗灵力,建议一天内不要超过3次,否则会降低准确度。<br />\r\n                                  ★骰子给出的结果需要你对行星,星座和宫位的关键字含义进行意会。<br />\r\n                                  ★如无法理解骰子的结果,可以把问题发出,等待专业占星师解答。</p><p style='color:#fffd64;'>若需购买占星骰子实物,请在淘宝搜索“超级占星骰子”</p>";
         try
         {
             GetTopic("");
             this.Repeater1.DataSource = this.GetReplys("");
             this.Repeater1.DataBind();
         }
         catch
         {
         }
     }
 }