在组件中如何使用session对象呀?

晚晨 2003-08-14 06:20:33
在用vb开发的组件中中如何使用session对象呢?
...全文
26 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
swans 2003-08-15
  • 打赏
  • 举报
回复
你在ASP页面中生成一个session变量并赋值, 再调用这个组件的
getSession(ID)看看是不是你的值..

=====================================
组件源文件.

Option Explicit

Private Response As ASPTypeLibrary.Response
Private Request As ASPTypeLibrary.Request
Private Session As ASPTypeLibrary.Session
Private Application As ASPTypeLibrary.Application
Private Server As ASPTypeLibrary.Server


'初始化
Public Sub onStartPage(my As ScriptingContext)
Set Request = my.Request
Set Response = my.Response
Set Session = my.Session
Set Server = my.Server
Set Application = my.Application
End Sub

Public Function getSession(ByVal ID As String)
if Trim(ID)<>"" then
getSession=Session(ID)
else
getSession=""
end if
End Function

'消毁
Public Sub onEndPage()
Set Request = Nothing
Set Response = Nothing
Set Session = Nothing
Set Server = Nothing
Set Application = Nothing
End Sub
swans 2003-08-15
  • 打赏
  • 举报
回复
引用asp.dll后.
真接用里面的session对象...
晚晨 2003-08-15
  • 打赏
  • 举报
回复
http://www.csdn.net/develop/Read_Article.asp?Id=6495
这篇文章找不到
chinesun 2003-08-14
  • 打赏
  • 举报
回复
这个文章里的说明介绍你去看看,一定对你有所帮助。
祝你成功
chinesun 2003-08-14
  • 打赏
  • 举报
回复
http://www.csdn.net/develop/Read_Article.asp?Id=6495

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧