我需要获取一个页面(只是一个图像)的内容,如http://11.11.11.11/code.aspx?product=33,但只有ip:22.22.22.22才能访问该文件。因此,我需要能够在http://22.22.22.22/pics.aspx?code=33等其他服务器上的pics.aspx文件中执行此操作
到目前为止,我在下面有这个脚本,可以获得?code=33
。现在,我所要做的就是检索http://11.11.11.11/code.aspx?product= subKeys(Counter2)
的内容。我以前和PHP合作过,所以我不知道我在用asp做什么。如果你能指导我如何通过它的网址检索另一个页面的内容,那将非常感激:)
<%@ Page Language="vb" %>
<html>
<head>
<title>Showing QueryString values via the QueryString Collection in ASP.NET</title>
</head>
<body>
<%
Dim Counter1, Counter2 As Integer
Dim Keys(), subKeys() As String
Dim MyQueryStringCollection As NameValueCollection
MyQueryStringCollection=Request.QueryString
Keys = MyQueryStringCollection.AllKeys
For Counter1 = 0 To Keys.GetUpperBound(0)
subKeys = MyQueryStringCollection.GetValues(Counter1) ' Get all values under this key.
If Keys(Counter1)="code" Then
Response.Write("Counter is "& Keys(Counter1) & "<br>" & subKeys(Counter2))
End If
subKeys = MyQueryStringCollection.GetValues(Counter1) ' Get all values under this key.
For Counter2 = 0 To subKeys.GetUpperBound(0)
' Response.Write("Value " & CStr(Counter2) & ": " & subKeys(Counter2) & "<br>")
Next Counter2
Next Counter1
%>
</body>
</html>