极光下载站 - 打造齐全的绿色软件家园

极光下载站

当前位置: 首页 技术开发 ASP专区 ASP,PHP,JS 版本完全挂Q程序源代码

ASP,PHP,JS 版本完全挂Q程序源代码

时间:2006/7/19 4:26:52 作者:佚名 人气:2992

1、ASP版
<%
dim objXMLHTTP, qq, pwd
  
qq = "100000"
pwd = "123456"
  
set objXMLHTTP = Server.CreateObject("MSXML2.XMLHTTP.5.0")
objXMLHTTP.open "POST", "http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp", false
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLHTTP.setRequestHeader "Connection", "Keep-Alive"
objXMLHTTP.send("qq="&qq&"&pwd="&pwd&"&FromWhere=register")
  
if InStr(objXMLHTTP.responseText, "验证失败") then
  response.write "登录失败"
else
  response.write "登录成功"
end if
  
set objXMLHTTP = nothing
%>

2、PHP版

<php
$qq = "100000"; //qq号码
$pwd = "123456"; //密码
  
$ch = curl_init();
  
curl_setopt($ch, CURLOPT_URL, "http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //这行是设定curl是否跟随header发送的location, 重要
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, "Connection", "Keep-Alive");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "qq=".$qq."&pwd=".$pwd."&FromWhere=register");
  
$return = curl_exec($ch);
  
curl_close($ch);
  
echo strstr($return, "postfield") ? "登录失败" : "登录成功";
?>

3、JS版
<p><span id="msg"></span><p><input type="button" onclick="doIt()" id="btn" value="登录" />
<script type="text/javascript">
var qq        = "100000";
var pwd       = "123456";
var sessionid = "";
var online    = false;
var re;

if (window.XMLHttpRequest) {
    var x = new XMLHttpRequest();
} else {
    var MSXML = new Array('MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP');
    for(var n = 0; n < MSXML.length; n ++) {
        try {
            var objXMLHTTP = new ActiveXObject(MSXML[n]);          
            break;
        } catch(e) {
        }
    }
}

function sendReq(method, url, data, callback) {
    with (objXMLHTTP) {
        open(method, url, false);
        setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        setRequestHeader("Connection", "Keep-Alive");
        send(data);
    }
    
    setTimeout(callback, 1);
}

function checkLogin() {
    if (objXMLHTTP.responseText.indexOf("postfield") > 0) {
        setMsg("密码错误或者号码不正确");
    } else {
        sessionid = objXMLHTTP.getResponseHeader("Set-Cookie").match(/JSESSIONID=([^;]+);/i)[1];
        sendReq("GET", "http://211.139.167.71/waptest/TWF/qqportal/qqchat/wait.jsp;jsessionid=" + sessionid + "?changestatus=40&random=" + Math.random()+ "&FromWhere=qqchatChangestatus", "", "setMsg('wait...');");
        
        online = true;
        setStatus();
        setBtn();
        
        re = setInterval("changeStatus();", 10000);
    }
}

function changeStatus() {
    sendReq("GET", "http://211.139.167.71/waptest/server;jsessionid=" + sessionid + "?productid=qqportal&actionid=qqchatChangestatus&saveURL=0&changestatus=40&random=" + Math.random(), "", "setMsg('wait');");
    sendReq("GET", "http://211.139.167.71/waptest/TWF/qqportal/qqchat/function.jsp;jsessionid=" + sessionid + "?qqlogout=1", "", "setStatus();");
}

function setStatus() {
    if (objXMLHTTP.responseText.match(/\[\d+\]\((\d+)\)/i)) {
        setMsg("QQ隐身,并有" + objXMLHTTP.responseText.match(/\[\d+\]\((\d+)\)/i)[1] + "条新消息");
        online = true;
    } else if ( objXMLHTTP.responseText.match(/qqlogout=first">(.*)\[\d+\]/i)) {
        setMsg(objXMLHTTP.responseText.match(/qqlogout=first">(.*)\[\d+\]/i)[1]);
        online = true;
    } else {
        setMsg("QQ离线");
        online = false;
    }
    
    setBtn();
}

function logout() {
    sendReq("GET", "http://211.139.167.71/waptest/server;jsessionid=" + sessionid + "?productid=qqportal&actionid=qqchatChangestatus&saveURL=0&changestatus=20&random=" + Math.random(), "", "setMsg('qq离线');");
    clearInterval(re);
    online = false;
    setBtn();
}

function setBtn() {
    if (online) {
        btn.value = "断开";
        btn.onclick = logout;
    } else {
        btn.value = "登录";
        btn.onclick = doIt;
    }
}

function setMsg(str) {
    document.getElementById("msg").innerHTML = str;
}

function doIt() {
    sendReq("POST", "http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp", "qq=" + qq + "&pwd=" + pwd + "&FromWhere=register", "checkLogin();");
}
</script>
<
标签
分享到:

公众号