dll出错?

szjia345 2006-04-25 02:16:52
dll源文件
..,,
'**********************************************
Private myscriptingcontext As ScriptingContext
Private myapplication As Application
Private myrequest As Request
Private myresponse As Response
Private myserver As Server
Private mysession As Session
'**********************************************
Public Sub onstartpage(passedscriptingcontext As ScriptingContext)
Set myscriptingcontext = passedscriptingcontext
Set myapplication = myscriptingcontext.Application
Set myrequest = myscriptingcontext.Request
Set myresponse = myscriptingcontext.Response
Set myserver = myscriptingcontext.Server
Set mysession = myscriptingcontext.Session
End Sub
Public Sub onendpage()
Set myscriptingcontext = Nothing
Set myapplication = Nothing
Set myrequest = Nothing
Set myresponse = Nothing
Set myserver = Nothing
Set mysession = Nothing
End Sub


Public Sub welcomeinfo()
myresponse.Write ("我做网管_web开发,欢迎访www.zhlw.com!")
End Sub


Public Sub setinfo(content As String)
myresponse.Write content & "<br>"
myresponse.Write "现在的时间是:" & Now()
End Sub

Public Function ExampleMethod(ByVal strName As String, _
ByVal intAge As Integer, _
Optional ByVal blnAgeEmphasisOn As Boolean = False) As String

'///// 建立局部变量
Dim strReturnString As String

'///// 创建返回的变量的值
strReturnString = strName & " is over " & CStr(intAge * 365)

'///// 完善strReturnString
If blnAgeEmphasisOn And intAge > 44 Then
strReturnString = strReturnString & " days OLD."
Else
strReturnString = strReturnString & " days old."
End If

'///// 返回字符串
ExampleMethod = strReturnString

End Function


asp源码
<%
set redll = server.createobject("aspdlla.demo")
redll.welcomeinfo
response.write "<hr />"
redll.setinfo("传递参数到服务器组件,并返回值及当前日期now()!")
response.write "<hr />"
aspName="Eric Clapton"
aspAge=56
aspEmphasis=True
strMethodReturn=redll.ExampleMethod(aspName,aspAge,aspMethodReturn)
'///// 将返回值发送给访问的浏览器
Response.Write(strMethodReturn)

set redll = nothing
%>

运行出错:
对象不支持此属性或方法: 'ExampleMethod'
...全文
238 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
僵哥 2006-04-25
  • 打赏
  • 举报
回复
在ASP里面的變量請先定義再使用,然後再試試看.

863

社区成员

发帖
与我相关
我的任务
社区描述
VB COM/DCOM/COM+
c++ 技术论坛(原bbs)
社区管理员
  • COM/DCOM/COM+社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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