protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; Database db = new Database(); if (IsPostBack) { if (tbUserName.Text.Trim() == "" || tbPwd.Text.Trim() == "") { _stt = "用户名或密码不能为空!"; MultiView1.SetActiveView(View2); } else { su.userName = tbUserName.Text.Trim(); su.Pwd = db.md5(tbPwd.Text.Trim()); if (!su.tryLogin()) { _stt = "请输入正确的用户名或密码!"; MultiView1.SetActiveView(View2); } else { _stt = "登陆成功!"; su.setCookies(); _Uid = su.Uid; MultiView1.SetActiveView(View3); } } } else { MultiView1.SetActiveView(View1); } }
protected void Page_Load(object sender, EventArgs e) { string _simpid; string userName; SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; if (su.isLogin) { _Uid = su.Uid; _simpid = su.getsimpleUid();//没加密的ID userName = su.userName; _netNameLink = "<a href=\"/User/Default.aspx?Cid=" + _Uid + "&v=1\">" + su.netName + "[ID=" + _simpid + "]</a>"; _money = db.getContent("userInfo", "money", "userName", userName); _login = "******"/User/Default.Aspx?Cid = " + _Uid + " & amp; v=1\">我的地盘</a>"; _login1 = "<a href=\"/User/Default.Aspx?AC=Exit&Cid =" + _Uid + " & amp; v=1\">安全退出</a>"; int newsNum = db.getNewsNumber(_simpid);//获取当前用户未读消息条数 if (newsNum > 0) { _message = "[系统]<a href=\"/User/MyXin.aspx?LX=0&Cid=" + _Uid + "&v=1\">你有(" + newsNum + ")条未读消息!</a>"; } SetPage();//加载开奖结果 } else { Response.Redirect("/User/Login.aspx?Cid=null& amp;v=1", false); } }
protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; if (su.isLogin) { string idNews; _Uid = su.Uid; idNews = Request["Sid"].ToString(); Database db = new Database(); SqlDataReader sqlreader; sqlreader = db.getDataReader("message", "source,news,time", "idNews", idNews);//查找消息 while (sqlreader.Read()) { _source = sqlreader["source"].ToString(); _time = sqlreader["time"].ToString(); _result = sqlreader["news"].ToString(); } db.close(); } else { Response.Redirect("/User/Login.aspx?Cid=<%=_Uid %>& amp;v=1"); } }
protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; if (su.isLogin) { string netName; string _simpid; Database db = new Database(); _Uid = su.Uid; netName = su.netName; _simpid = su.getsimpleUid(); SqlDataReader sqlreader; sqlreader = db.getDataReader("message", "idSend,news,idNews", "idReceive", _simpid, "status", "未读");//获取当前用户未读消息 while (sqlreader.Read()) { if (sqlreader["idSend"].ToString() == "2") { _result = "<a href=\"/User/Xin_Look.Aspx?Sid=" + sqlreader["idNews"] + "&Cid=" + _Uid + "&v=1\">" + sqlreader["news"] + "</a>" + "<br/>" + _result; } else { _result = "<a href =\"/User/Xin_Add.Aspx?Sid=" + sqlreader["idSend"] + "&Cid=" + _Uid + "&v=1\" >" + sqlreader["news"] + "</a> " + "<br/>" + _result; } } db.close(); } else { Response.Redirect("/User/Login.aspx?Cid=<%=_Uid %>& amp;v=1"); } }
protected string _idReceive; //消息接收者id protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; Database db = new Database(); if (su.isLogin) { string _chartContent = ""; string _netName; string _simpid; _Uid = su.Uid; _netName = su.netName; _simpid = su.getsimpleUid(); _idReceive = Request["Sid"]; _chartContent = Request["Text"]; if (_chartContent != "") { db.insertContent("message", "idSend", "idReceive", "netName", "news", "status", "source", "time", _simpid, _idReceive, _netName, _chartContent, "未读", _netName, DateTime.Now.ToString("yyyy-MM-dd H:mm:ss")); _send = "消息发送成功!!"; } else { _send = "请输入您要发送的内容!"; } } else { Response.Redirect("/User/Login.aspx?Cid=<%=_Uid %>& amp;v=1"); } }
protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; if (su.isLogin) { string netName; string _simpid; string _dateTime = "";//消息发送距离现在的时间 _Uid = su.Uid; netName = su.netName; _simpid = su.getsimpleUid(); Database db = new Database(); _idReceive = Request["Sid"]; SqlDataReader sqlreader; sqlreader = db.getDataReaderor("message", "netName,news,time,status", "idSend", _simpid, "idReceive", _idReceive); while (sqlreader.Read()) { _time = sqlreader["time"].ToString(); _dateTime = gettime(); if (sqlreader["netName"].ToString() == netName) { _chatContent = "我:" + sqlreader["news"] + "(" + _dateTime + "," + sqlreader["status"] + ")<br />" + _chatContent; } else { _chatContent = sqlreader["netName"] + ":" + sqlreader["news"] + "(" + _dateTime + "," + sqlreader["status"] + ")<br />" + _chatContent; } } db.close(); } else { Response.Redirect("/User/Login.aspx?Cid=<%=_Uid %>& amp;v=1"); } }
protected void Page_Load(object sender, EventArgs e) { string qishuS; SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; Database db = new Database(); string time = dt.ToString("yyyyMMdd"); //用于期数的年月日 string time0 = dt.ToShortDateString(); //用于给javascript的截止时间的年月日 long time1 = GetTimeStamp(); long todayStamp = time1 % (24 * 60 * 60 * 1000); _P = Request["P"]; if (_P == "1") { _ballName = "第1球大小"; } else if (_P == "2") { _ballName = "第2球大小"; } else if (_P == "3") { _ballName = "第3球大小"; } else if (_P == "4") { _ballName = "第4球大小"; } else { _ballName = "第5球大小"; _P = "5"; } if (todayStamp < 30 * 60 * 1000) { qishu = 59; } else if (todayStamp < (3 * 60 * 60 * 1000 + 11 * 60 * 1000)) { int qishuNum = (int)(todayStamp - 30 * 60 * 1000) / (20 * 60 * 1000) + 1; qishu = qishuNum; } else if (todayStamp < (7 * 60 * 60 * 1000 + 30 * 60 * 1000)) { qishu = 9; } else { int qishuNum1 = (int)(todayStamp - (7 * 60 * 60 * 1000 + 30 * 60 * 1000)) / (20 * 60 * 1000) + 10; qishu = qishuNum1; } if (qishu < 10) { qishuS = "00" + qishu; } else { qishuS = "0" + qishu; } currentQishu = "当前期数:第" + time + "-" + qishuS + "期";//显示当前期数号:年月日期数号 if (qishu == 59) { data = time0 + " 00:27:42"; } else if (qishu < 9) { int t0 = 27 * 60 + 52; //第一期截至时相对当天0时的秒数 int t_1 = 20 * 60; //每一期增加的秒数 int times = qishu; int totle = t0 + t_1 * times; int hour = totle / 3600; int min = totle % 3600 / 60; int sec = totle % 60; data = time0 + " " + hour + ":" + min + ":" + sec; } else { int t0 = 7 * 3600 + 27 * 60 + 52; //早上7:30开 int t_1 = 20 * 60; //每一期增加的秒数 int times = qishu - 9; int totle = t0 + t_1 * times; int hour = totle / 3600; int min = totle % 3600 / 60; int sec = totle % 60; data = time0 + " " + hour + ":" + min + ":" + sec; } //判断登陆 if (su.isLogin) { _Uid = su.Uid; userName = su.userName; netName = su.netName; _simpid = su.getsimpleUid(); _netNameLink = "<a href=\"/User/Default.aspx?Cid=" + _Uid + "&v=1\">" + su.netName + "[ID=" + _simpid + "]</a>"; _money = db.getContent("userInfo", "money", "userName", userName); _login = "******"/User/Default.Aspx?Cid = " + _Uid + " & amp; v=1\">我的地盘</a>"; _login1 = "<a href=\"/User/Default.Aspx?AC=Exit&Cid =" + _Uid + " & amp; v=1\">安全退出</a>"; int newsNum = db.getNewsNumber(_simpid);//获取当前用户未读消息条数 if (newsNum > 0) { _message = "[系统]<a href=\"/User/MyXin.aspx?LX=0&Cid=" + _Uid + "&v=1\">你有(" + newsNum + ")条未读消息!</a>"; } } string periodBet; string qishu0;//不带日期,但前面加0的期数 if (qishu == 59) { periodBet = dt.AddDays(1).ToString("yyyyMMdd") + "001"; } else { if (qishu < 9) { qishu0 = "00" + (qishu + 1); } else { qishu0 = "0" + (qishu + 1); } periodBet = time + qishu0;//显示当前投注期数号:年月日期数号 } if (db.isStopBet(periodBet, "cqsscResult"))//判断是否截止 { _stopOrSuccess = "本期已经截止!"; MultiView1.SetActiveView(View3); } else { if (Request["Ac"] == "Bet") { if (int.Parse(Request["v"]) == 1) { if (Request["Multiple"] == "" || Request["P1"] == "") { MultiView1.SetActiveView(View1); } else { if (int.Parse(Request["P1"]) == 1) { _a = "小"; } else { _a = "大"; } _b = Request["Multiple"]; int i = int.Parse(_b); winMoney = (i * 1.97).ToString();//赔率暂时这样设置,等正常使用,再调用数据库设置赔率 if (!su.isLogin) { _d = "卵弹琴,你没有那么多金币,<a href=\"/User/Default.aspx?Cid=<%=_Uid %>\" >前去充值</ a>"; MultiView1.SetActiveView(View2); } else { if (float.Parse(db.getContent("userInfo", "money", "userName", userName)) < i) { _d = "卵弹琴,你没有那么多金币,<a href=\"/User/Default.aspx?Cid=<%=_Uid %>\" >前去充值</ a>"; MultiView1.SetActiveView(View2); } else { Session["position"] = _a; Session["positionType"] = _ballName; Session["money"] = _b; Session["winMoney"] = winMoney; _d = "<input type=\"submit\" class=\"submit\" value=\"立即下注\" >"; MultiView1.SetActiveView(View2); } } } } else if (int.Parse(Request["v"]) == 2)//V=2代表一切投注条件都满足了,包括余额充足 { positionType = Session["positionType"].ToString(); _a = Session["position"].ToString(); _b = Session["money"].ToString();//总共费用 winMoney = Session["winMoney"].ToString(); //string period = DateTime.Now.ToString("yyyyMMdd") + qishu; int check = db.bet("cqssc", userName, netName, periodBet, _a, positionType, _b, "Bet", winMoney, DateTime.Now.ToString("yyyy-MM-dd h:mm:ss")); if (check == 1) { float moneys = float.Parse(db.getContent("userInfo", "money", "userName", userName)); float remainMoney = moneys - float.Parse(_b); db.updateContent("userInfo", "money", remainMoney.ToString(), "userName", su.userName); _stopOrSuccess = "恭喜你,下注成功!"; MultiView1.SetActiveView(View3); } } } else { MultiView1.SetActiveView(View1); } } string period0 = time + qishu; //最近开奖的这期 string resultball5 = db.getContent("cqsscResult", "resultBall", "period", period0); //获取五个球开奖结果 if (resultball5 != "") { string[] arr = resultball5.Split('-'); ball1 = arr[0]; ball2 = arr[1]; ball3 = arr[2]; ball4 = arr[3]; ball5 = arr[4]; _result = " <div >" + ball1 + "</ div><div >" + ball2 + "</ div ><div >" + ball3 + "</ div><div >" + ball4 + "</ div><div>" + ball5 + "</ div>"; } else { _result = " <div >摇</ div>"; } }
protected void Page_Load(object sender, EventArgs e) { SupperUserInfo su = (SupperUserInfo)Session["userInfor"]; Database db = new Database(); string time = dt.ToString("yyyyMMdd"); string monthDay = dt.ToString("MM-dd"); int year = (int)dt.Year; int month = (int)dt.Month; int day = (int)dt.Day; int hour = 0; //小时 int min = 0; //分钟 int sec = 0; //秒 _tongGao = db.getContent("tongGao", "message"); //获取通告 //计算最近已经开奖的期数 long time1 = GetTimeStamp(); long todayStamp = time1 % (24 * 60 * 60 * 1000); if (todayStamp < 30 * 60 * 1000) { qishu = 59; } else if (todayStamp < (3 * 60 * 60 * 1000 + 11 * 60 * 1000)) { int qishuNum = (int)(todayStamp - 30 * 60 * 1000) / (20 * 60 * 1000) + 1; qishu = qishuNum; } else if (todayStamp < (7 * 60 * 60 * 1000 + 30 * 60 * 1000)) { qishu = 9; } else { int qishuNum1 = (int)(todayStamp - (7 * 60 * 60 * 1000 + 30 * 60 * 1000)) / (20 * 60 * 1000) + 10; qishu = qishuNum1; } if (su.isLogin)//判断是否已经登陆 { string _simpid; _simpid = su.getsimpleUid(); _Uid = su.Uid; userName = su.userName; int betMoney = 0; string betPeriod; //带日期期数 string qishu0; //不带日期,但前面加0的期数 _netNameLink = "<a href=\"/User/Default.aspx?Cid=" + _Uid + "&v=1\">" + su.netName + "[ID=" + su.getsimpleUid() + "]</a>"; _money = db.getContent("userInfo", "money", "userName", userName); _login = "******"/User/Default.Aspx?Cid = " + _Uid + " & amp; v=1\">我的地盘</a>"; _login1 = "<a href=\"/User/Default.Aspx?AC=Exit&Cid =" + _Uid + " & amp; v=1\">安全退出</a>"; int newsNum = db.getNewsNumber(_simpid);//获取当前用户未读消息条数 if (newsNum > 0) { _message = "[系统]<a href=\"/User/MyXin.aspx?LX=0&Cid=" + _Uid + "&v=1\">你有(" + newsNum + ")条未读消息!</a>"; } //获取投注期的带日期期号 if (qishu == 59) { betPeriod = dt.AddDays(1).ToString("yyyyMMdd") + "001"; qishu0 = "001"; } else { if (qishu < 9) { qishu0 = "00" + (qishu + 1); } else { qishu0 = "0" + (qishu + 1); } betPeriod = time + qishu0;//显示当前投注期数号:年月日期数号 } betMoney = db.getBetMoney("cqssc", betPeriod); _currentBet = "本期已下注:<a href=\"\">" + betMoney + "</a>金币";//获取当期投注总额 } //获取开奖号码 string qishuS; if (qishu < 10) { qishuS = "00" + qishu; } else { qishuS = "0" + qishu; } string period0 = time + qishuS; //最近开奖的这期 string resultball5 = db.getContent("cqsscResult", "resultBall", "period", period0); //获取五个球开奖结果 if (resultball5 != "") { string[] arr = resultball5.Split('-'); _ball = " <a href = \"/ssc/List.Aspx?Cid=" + _Uid + "&v=1\" > " + arr[0] + " </a><a href = \"/ssc/List.Aspx?Cid=" + _Uid + "&v=1\" >" + arr[1] + "</ a><a href = \"/ssc/List.Aspx?Cid=" + _Uid + "&v=1\" >" + arr[2] + "</ a><a href = \"/ssc/List.Aspx?Cid=" + _Uid + "&v=1\" >" + arr[3] + "</ a><a href = \"/ssc/List.Aspx?Cid=" + _Uid + "&v=1\" >" + arr[4] + "</ a>"; } //设置当前期数用于显示 if (qishu == 59) { double stampNotOneday = GetTimeStamp() % (24 * 60 * 60 * 1000); //获取不足一天的时间戳 int remainHour = (int)stampNotOneday / (60 * 60 * 1000); //获取时间戳的小时数; if (remainHour == 0) { _currentQishu = time + "-001";//显示当前期数号:年月日期数号 } else { _currentQishu = dt.AddDays(1).ToString("yyyyMMdd") + "-001";//显示当前期数号:年月日期数号 } } else { string qishuS0; if (qishu < 9) { qishuS0 = "-00" + (qishu + 1); } else { qishuS0 = "-0" + (qishu + 1); } _currentQishu = time + qishuS0;//显示当前期数号:年月日期数号 } //计算截至时间和距离开奖时间 if (qishu == 59) { hour = 0; min = 27; sec = 52; } else if (qishu < 9) { int t0 = 27 * 60 + 52; //第一期截至时相对当天0时的秒数 int t_1 = 20 * 60; //每一期增加的秒数 int times = qishu; int totle = t0 + t_1 * times; hour = totle / 3600; min = totle % 3600 / 60; sec = totle % 60; } else { int t0 = 7 * 3600 + 27 * 60 + 52; //早上7:30开 int t_1 = 20 * 60; //每一期增加的秒数 int times = qishu - 9; int totle = t0 + t_1 * times; hour = totle / 3600; min = totle % 3600 / 60; sec = totle % 60; } //计算截止剩余时间 TimeSpan timeSpan = new DateTime(year, month, day, hour, min, sec) - dt; double totalsec = timeSpan.TotalSeconds; if (totalsec < 0) { _stopTime = "本期已截止!"; } else { int min0 = (int)totalsec / 60; int sec0 = (int)totalsec % 60; if (min0 > 0) { _stopTime = min0 + "分钟" + sec0 + "秒"; } else { _stopTime = sec0 + "秒"; } } //计算下期还剩余多久时间 int remainmin = min + 3; int remainsec = sec - 51; TimeSpan timeSpan1 = new DateTime(year, month, day, hour, remainmin, remainsec) - dt;//提前2分9秒截止 double totalsec1 = timeSpan1.TotalSeconds; if (totalsec1 < 0) { _openTime = "00分钟00秒"; } else { int min1 = (int)totalsec1 / 60; int sec1 = (int)totalsec1 % 60; if (min1 > 0) { _openTime = min1 + "分钟" + sec1 + "秒"; } else { _openTime = sec1 + "秒"; } } _nextPeriod = qishu; //下一期期数 _datetime = monthDay + " " + hour + ":" + (min + 3); //本期开奖时间 }