dll出错?
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'