Thanks
Leon
Runs on Windows 2000 Server
ASP:
<%@ Language="VBSCript" %>
<% Option Explicit %>
<% Response.Buffer = true %>
<%
Dim strInUrl, strPage, objInet, strInQuery, strInCookie
On Error Resume Next
'response.write Request.ServerVariables("ALL_HTTP")
'response.end
strInUrl = Request.ServerVariables("URL")
strInQuery = Request.ServerVariables("QUERY_STRING")
strInCookie = Request.ServerVariables("HTTP_COOKIE")
strInUrl = lcase(strInUrl)
strInUrl = replace(strInUrl,"/devportal/rlocator","")
strInUrl = "http://newServerName" & strInUrl & "?" & strInQuery
Set objInet = Server.CreateObject ("Wrapper.GetPage")
If Err.Number <> 0 Then
Set objInet = nothing
Response.Write ("Error while processing the request")
Response.End
End If
strPage = objInet.DownloadPage(CStr(strInUrl), CStr(strInCookie))
Set objInet = nothing
' *** Do something with the page downloaded
Response.Write strPage
%>
DLL:
Option Explicit
Dim strUrl As String
'Dim strCookie As String
Dim intPort As Integer
Const intBufSize = 3000
Public Function DownloadPage(strUrl As String, strCookie As String) As
String
Dim strBuffer As String * 1000
Dim lngHandle1 As Long
Dim lngHandle2 As Long
Dim intRetVal As Long
Dim intRetSize As Long
Dim strOut As String
Dim lngCookie As Long
DoEvents
lngCookie = Len(strCookie)
lngHandle1 = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT, "",
"", 0)
lngHandle2 = InternetOpenUrl(lngHandle1, strUrl, strCookie, lngCookie,
INTERNET_FLAG_RAW_DATA, 0)
Do While True
DoEvents
strBuffer = Space(1000)
intRetVal = InternetReadFile(lngHandle2, strBuffer, 1000,
intRetSize)
If intRetSize = 0 Then
Exit Do
End If
strOut = strOut & strBuffer
Loop
InternetCloseHandle (lngHandle2)
InternetCloseHandle (lngHandle1)
DownloadPage = strOut
End Function
<<INTERNET_FLAG_NO_COOKIES
Does not automatically add cookie headers to requests, and does not
automatically add returned cookies to the cookie database. This flag can be
used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).>>
I hope that helps,
Ozgur
x <x...@x.com> wrote in message news:9749cf$nkb$1...@bob.news.rcn.net...