110,534
社区成员
发帖
与我相关
我的任务
分享
HttpHelper httpHelper87 = new HttpHelper("http://ux87.com/");
这个服务器地址是传给请求标头的host的。
然后
string strHtml = httpHelper87.GetHtml("http://ux87.com/login.php");
pBox.Image = new System.Drawing.Bitmap(httpHelper87.GetHtmlToStream("http://ux87.com/imgcode.php", out ckcCookies));
ckcCookies是接收到的Cookie
strTimeStamp = DateTimeToStamp(DateTime.Now);这个是时间截,单位秒
string strCookieDoAction = "PHPSESSID=" + ckcCookies["PHPSESSID"].Value +
";Hm_lvt_7d781f93d49f3f4bb9e93736f01feb3a="
+ strTimeStamp +"; Hm_lpvt_7d781f93d49f3f4bb9e93736f01feb3a=" + strTimeStamp;
string strPostDataDoAction = "username=enagen001&password=123456&codevalue="
+ txtCode1.Text.Trim() + "&rme=on&code=code&act=login";
string strHttpReturnDoAction = httpHelper87.GetHtmlPost
("http://ux87.com/DoAction.php",strPostDataDoAction,strCookieDoAction, out ckcCookiesDoAction);
string strCookieindex = strCookieDoAction + "; " + ckcCookiesDoAction["user_id"].ToString() + "; "
+ckcCookiesDoAction["user_name"].ToString();
string strReturnIndex = httpHelper87.GetHtml("http://ux87.com/index.php", strCookieindex);
string strTimeStampGame_Play = DateTimeToStamp(DateTime.Now);
string strCookieGame_Play = ckcCookies["PHPSESSID"].ToString() +
"; Hm_lvt_7d781f93d49f3f4bb9e93736f01feb3a="
+ strTimeStamp + "; Hm_lpvt_7d781f93d49f3f4bb9e93736f01feb3a=" + strTimeStampGame_Play + "; " +
ckcCookiesDoAction["user_id"].ToString() + "; " + ckcCookiesDoAction["user_name"].ToString();
CookieCollection ckcGame_Play;
string strReturnGame_Play = httpHelper87.GetHtml("http://ux87.com/game_play.php?id=50116",
strCookieGame_Play, out ckcGame_Play);
function checkInput(){
var flag = true;
if(document.myLogin.username.value.length == 0){
alert('用户名不得为空!');
flag = false;
}
if(flag && document.myLogin.password.value.length == 0){
alert('密码不得为空!');
flag = false;
}
if(flag) document.myLogin.submit();
}
<!-- 登录前 start -->
<div class="index_login_20131027">
<form name="myLogin" action="DoAction.php" method="post">
<!-- <img src="images/i_tool_t.jpg" width="231" height="5" /> -->
<ul class="i_login_ul">
<li>帐 号:</li>
<li>密 码:</li>
</ul>
<ul class="i_login_ul1">
<input type="text" name="username" id="username" class="i_login_input" value="" />
<input type="password" name="password" id="password" class="i_login_input" />
<input type="checkbox" name="rme" id="rme" class="i_login_input1" /> <font class="i_login_text">记住登录帐号</font>
</ul>
<ul class="i_log_bot">
<table border="0" cellspacing="0" class="botton">
<tr><td class="botton_td"><a href="#" onclick="checkInput();">用户登录</a></td><td class="botton_td_r"></td></tr>
</table>
</ul>
<ul class="i_re_pass">
<a href="register.php" target="_blank" title="游戏用户注册">免费注册</a>
</ul>
<ul class="i_re_pass">
<font><a href="forgetpass.php" target="_blank" >忘记密码?</a></font>
</ul>
<!-- <img src="images/i_tool_b.jpg" width="231" height="6" /> -->
<input type="hidden" name="act" id="act" value="login" />
<input type='hidden' id='FromURL' name='FromURL' value='/'/>
</form>