网络编程
位置:首页>> 网络编程>> Asp编程>> 个人网站与动网整合非官方方法(3)

个人网站与动网整合非官方方法(3)

  发布时间:2009-07-05 18:42:00 

标签:个人网站,动网,整合

六、后记

本次测试的论坛版本为Version 7.1.0 Sp1,未对其他版本做进行测试,大家有时间都可测下,望告知结果。凌晨五点了,睡觉先...

2008-06-09说明:

上边修改方法只对Dvbbs8.0(含8.0)以下版本有效,而对Dvbbs8.1(含8.1)以上版本,CheckUserLogin.asp需稍做修改:

程序代码

<%
Set Dvbbs = New Cls_Forum
%>
<!--#Include File="bbs/inc/Dv_ClsMain.asp"-->
<%
Function CheckUserLogin()
    Dim UserSession
    Const MsxmlVersion=".3.0"
    Set UserSession=Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
    If UserSession.loadxml(Session(Dvbbs.CacheName & "UserID")&"") Then
        If UserSession.documentElement.selectSingleNode("userinfo/@userid").text<>"0" Then
            '在论坛登录成功
            CheckUserLogin = True
            '下边是用户一些信息的获取方法,可自行将其保存于Cookies或Session中便于使用:
            '用户ID      :  UserSession.documentElement.selectSingleNode("userinfo/@userid").text
            '用户名      :  UserSession.documentElement.selectSingleNode("userinfo/@username").text
            '生日        :  UserSession.documentElement.selectSingleNode("userinfo/@userbirthday").text
            '电子邮箱    :  UserSession.documentElement.selectSingleNode("userinfo/@useremail").text
            '性别        :  UserSession.documentElement.selectSingleNode("userinfo/@usersex").text  '0为女,1为男
            '注册时间    :  UserSession.documentElement.selectSingleNode("userinfo/@joindate").text
            '最后登录    :  UserSession.documentElement.selectSingleNode("userinfo/@lastlogin").text
            '登录次数    :  UserSession.documentElement.selectSingleNode("userinfo/@userlogins").text
            '金钱        :  UserSession.documentElement.selectSingleNode("userinfo/@userwealth").text
            '积分        :  UserSession.documentElement.selectSingleNode("userinfo/@userep").text
            '魅力        :  UserSession.documentElement.selectSingleNode("userinfo/@usercp").text
            '最后登录IP  :  UserSession.documentElement.selectSingleNode("userinfo/@userlastip").text
            '浏览器类型  :  UserSession.documentElement.selectSingleNode("agent/@browser").text
            '浏览器版本  :  UserSession.documentElement.selectSingleNode("agent/@version").text
            '操作系统    :  UserSession.documentElement.selectSingleNode("agent/@platform").text
            '来访IP      :  UserSession.documentElement.selectSingleNode("agent/@ip").text
            '举例应用:
            Response.Cookies("username") = UserSession.documentElement.selectSingleNode("userinfo/@username").text
            Response.Cookies("joindate") = UserSession.documentElement.selectSingleNode("userinfo/@joindate").text
            If UserSession.documentElement.selectSingleNode("userinfo/@usersex").text="0" Then
                Response.Cookies("sex") = "靓妹"
            Else
                Response.Cookies("sex") = "酷哥"
            End if
            Response.Cookies("lastlogin") = UserSession.documentElement.selectSingleNode("userinfo/@lastlogin").text
            Response.Cookies("userlogins") = UserSession.documentElement.selectSingleNode("userinfo/@userlogins").text
            Response.Cookies("browser") = UserSession.documentElement.selectSingleNode("agent/@browser").text
            Response.Cookies("version") = UserSession.documentElement.selectSingleNode("agent/@version").text
            Response.Cookies("platform") = UserSession.documentElement.selectSingleNode("agent/@platform").text
        Else
            '访问过论坛尚未登录,为来宾状态
            CheckUserLogin = False
        End if
    Else
        '未访问过论坛
        CheckUserLogin = False
    End if
    Set UserSession = nothing
    Set Dvbbs = nothing
End Function
%>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com