G
Guest
Can someone please tell me how I do something like this in ASP.NET!
I have the following ASP script that pulls part of a webpage from one
website and then inserts that into my site!
How do you do this in ASP.NET
Thanks for any help!
I'm a little stuck with this!
<%
Dim StrURL
Dim StrHTML
Dim ObjWeather
StrURL1 = "http://weather.lycos.com/?q="&("Copenhagen, Denmark")
StrURL =
"http://weather.lycos.com/weather/seven_day_forecast.asp?q="&("Copenhagen,
Denmark")
strmetric="http://weather.lycos.com/weather/setprefs.asp?units=metric"
If Not "Copenhagen, Denmark" = "" Then
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURLm = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", strmetric, False, "", ""
.Send
GetURLm = .ResponseText
End With
Set LobjWeather = Nothing
strHTMLm = GetURLm
end if
If Not "Copenhagen, Denmark" = "" Then
Dim strText
On Error Resume Next
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURL1 = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", StrURL1, False, "", ""
.Send
GetURL1 = .ResponseText
End With
Set LobjWeather = Nothing
strHTML1 = GetURL1
end if
If Not "Copenhagen, Denmark" = "" Then
Dim strText1
On Error Resume Next
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURL = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", StrURL, False, "", ""
.Send
GetURL = .ResponseText
End With
Set LobjWeather = Nothing
strHTML = GetURL
end if
%>
<%
If Not "Copenhagen, Denmark" = "" Then
StrHTML = GetURL
myarr=split (StrHTML,"<!-- BeginMainColumn -->", -1, 1)
myarr2=split (myarr(3),"<!-- EndMainColumn -->", -1, 1)
stringu=myarr2(0)
Response.Write stringu
'Response.Write Replace(Server.HTMLEncode(stringu), vbCrLf, "<BR>")
End If
%>
I have the following ASP script that pulls part of a webpage from one
website and then inserts that into my site!
How do you do this in ASP.NET
Thanks for any help!
I'm a little stuck with this!
<%
Dim StrURL
Dim StrHTML
Dim ObjWeather
StrURL1 = "http://weather.lycos.com/?q="&("Copenhagen, Denmark")
StrURL =
"http://weather.lycos.com/weather/seven_day_forecast.asp?q="&("Copenhagen,
Denmark")
strmetric="http://weather.lycos.com/weather/setprefs.asp?units=metric"
If Not "Copenhagen, Denmark" = "" Then
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURLm = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", strmetric, False, "", ""
.Send
GetURLm = .ResponseText
End With
Set LobjWeather = Nothing
strHTMLm = GetURLm
end if
If Not "Copenhagen, Denmark" = "" Then
Dim strText
On Error Resume Next
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURL1 = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", StrURL1, False, "", ""
.Send
GetURL1 = .ResponseText
End With
Set LobjWeather = Nothing
strHTML1 = GetURL1
end if
If Not "Copenhagen, Denmark" = "" Then
Dim strText1
On Error Resume Next
Set lObjWeather = Server.CreateObject ("Microsoft.XMLHTTP")
If Err Then
GetURL = "Error: " & Err.Description
End If
On Error Goto 0
With lObjWeather
.Open "GET", StrURL, False, "", ""
.Send
GetURL = .ResponseText
End With
Set LobjWeather = Nothing
strHTML = GetURL
end if
%>
<%
If Not "Copenhagen, Denmark" = "" Then
StrHTML = GetURL
myarr=split (StrHTML,"<!-- BeginMainColumn -->", -1, 1)
myarr2=split (myarr(3),"<!-- EndMainColumn -->", -1, 1)
stringu=myarr2(0)
Response.Write stringu
'Response.Write Replace(Server.HTMLEncode(stringu), vbCrLf, "<BR>")
End If
%>