<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Dim ASPNETResources
ASPNETResources = GetASPNetResources()
Application("ASPNETExpires") = 12
If Len(ASPNETResources) >0 then
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if
End Sub
</script>
<!-- #include file="i_soapcall.asp" -->
<%
Dim ASPNETResources
If len( Application("ASPNETResourceList") )>0 then
If DateDiff("h",Now(),Application("ASPNETResourcesUpdated")) > Application("ASPNETExpires") Then
ASPNETResources = GetASPNetResources()
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if
Else
ASPNETResources = GetASPNetResources()
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if
Response.Write Application("ASPNETResourceList")
%>
oServerXMLHTTPRequest.open bstrMethod, bstrUrl, bAsync, bstrUser, bstrPassword
Parameters
bstrMethod
HTTP method used to open the connection, such as PUT or PROPFIND.
bstrUrl
Requested URL. This must be an absolute URL, such as "http://Myserver/Mypath/Myfile.asp".
bAsync (optional)
Boolean. Indicator as to whether the call is asynchronous. The default is False (the call does not
return immediately).
bstrUser (optional)
Name of the user for authentication.
bstrPassword (optional)
Password for authentication. This parameter is ignored if the user parameter is Null or missing
<script language="vbscript" runat="server">
Function GetASPNetResources()
Dim returnString
Dim myXML
Dim SoapRequest
Dim SoapURL
Set SoapRequest = Server.CreateObject("MSXML2.XMLHTTP")
Set myXML =Server.CreateObject("MSXML.DOMDocument")
myXML.Async=False
SoapURL = "http://64.85.12.73/WebSvc/whatsnew123apx_ds.asmx/GetNew123aspXResources?"
'這是真實可用的webservice
SoapRequest.Open "GET",SoapURL , False
SoapRequest.Send()
if Not myXML.load(SoapRequest.responseXML) then 'an Error loading XML
returnString = ""
Else 'parse the XML
Dim nodesURL
Dim nodesName
Dim nodesDateUpdated
Dim nodesDomain
Dim NumOfNodes
Dim ResourceList
Dim i
REM -- The XML Nodes are CASE SENSITIVVE!
Set nodesURL=myXML.documentElement.selectNodes("//URL")
Set nodesName=myXML.documentElement.selectNodes("//Name")
REM -- uncomment the following lines if we want to access the DataUpdated and the Domain Nodes
REM --Set nodesDateUpdated = myXML.documentElement.selectNodes("//DateUpdated")
REM --Set nodesDomain = myXML.documentElement.selectNodes("//Domain")
REM -- the number of nodes in the list
NumOfNodes = nodesURL.Length
ResourceList = "<font face=verdana size=2>Latest ASP.NET Resources</font><ul>"
For i = 0 to NumOfNodes -1
ResourceList = ResourceList & "<li><a href=" & nodesURL(i).text & "><font face=verdana size=2>" &
nodesName(i).text & "</font></a></li>"
next
ResourceList =ResourceList & "</ul>"
returnString = ResourceList
Set nodesURL = Nothing
Set nodesName = Nothing
End If
Set SoapRequest = Nothing
Set myXML = Nothing
GetASPNetResources = returnString
End Function
</script>