Public Function GetHTML(ByVal sURL As String, ByVal e As Integer) As String
Dim oHttpWebRequest As System.Net.HttpWebRequest
Dim oStream As System.IO.Stream
Dim sChunk As String
oHttpWebRequest = (System.Net.HttpWebRequest.Create(sURL))
Dim oHttpWebResponse As System.Net.WebResponse = oHttpWebRequest.GetResponse()
oStream = oHttpWebResponse.GetResponseStream
sChunk = New System.IO.StreamReader(oStream).ReadToEnd()
oStream.Close()
oHttpWebResponse.Close()
If e = 0 Then
Return Server.HtmlEncode(sChunk)
Else
Return Server.HtmlDecode(sChunk)
End If
End Function
And here's how to do it in PHP
$file = file_get_contents('http://www.yoururl.com');
*snicker*
No comments:
Post a Comment