个人网站与动网整合非官方方法(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
%>
猜你喜欢
- 用ASP生成XBM数字图片(可用来生成验证码)XBM图片是一个纯文本的文件,可以用ASP来自动生成。可以用它来使用网站登陆的验证码;我们用记
- 看看怎样抓到你:<%Dim objCMFUDim strModifiedSet objCMFU 
- 我很想自己写一个这样的程序,不过wordpress是php的,我blog是ASP的,只好用ASP写代码了。经过一番折腾测试,终于让我的梦想变
- match()方法用于从字符串中查找指定的值本方法类似于indexOf()和lastindexOf(),不同的是它返回的是指定的值,而不是指
- 问题当浏览SQL Server 2008的新特性时,我们看到了透明数据加密。这看起来很有趣。您能为我们解释一下并介绍下执行它的细节吗?专家解
- 对于数据库管理员来说,可以经常想了解一些之前未听说过的存储过程,特别是无文档类型的存储过程。或许是用这些存储过程,能够简化日常的数据管理。为
- 如果您刚刚开始接触网页设计,是不是经常发生这样的问题呢?做好的网页在自己机器上可以正常浏览,而把页面传到服务器上就总是出现看不到图片,css
- 在分析sIFR之前,先来快速的了解一下sIFR是什么,以及它是如何工作的。sIFR表示scalable Inman Flash Replac
- asp.net的dropdownlist控件为我们的web应用提供了许多用处,但有一点我总感觉不爽的就是在使用dropdownlist的事件
- innerHTML,outerHTML innerHTML检索或设置标签内的内容;outerHTML检索或设置整个标签的内容(包含标签)。&
- 强大的group by 代码如下:select stdname, isnull(sum( case stdsubject whe
- 了兑现我对大家的承诺,我们现在立即就将“借助数据库和ASP程序”编写出来的,可以同时适用于IIS和P
- © 版权符号显示不清楚,就是那个圈C,在某些网站上就是显示太小,看不清楚。一开始还以为是字体大小的原因,调大以后,还是一样
- Google Chrome,又喜欢逛豆瓣,Google Chrome支持User Scripts了,但是我写的那几个插件在Chrome下又跑
- 在本篇文章里,我们会使用一个简单的Web表单,它会列出某个目录下的一些XML文件。然后,我们会从这个目录里选择一个文件,将它发送到另一个We
- 好多次在不同场合,都听到有同行提到“做产品比做设计更有前途”,或者“别做设计了,做产品吧”类似的观点。我不认为它们之间有什么可比性,因为这么
- Abs (数值)绝对值。一个数字的绝对值是它的正值。空字符串 (null) 的绝对值,也是空字符串。未初始化的变数,其绝对为 0例子:ABS
- 以下以 IE 代替 Internet Explorer,以 MF 代替 Mozzila FF1. document.form.item 问题
- jQuery的选择器是CSS 1-3,XPath的结合物。jQuery提取这二种查询语言最好的部分,融合后创造出了最终的jQuery表达式查
- 我想大多数的人在编写ASP程序的时候,都碰到过类似的错误信息: Error Number ->