Reading remote sites in ASP.NET or PHP |
Post Reply |
Author | |
Administrator
Admin Group Joined: January/25/2003 Location: United States Status: Offline Points: 809 |
Post Options
Thanks(0)
Posted: October/17/2003 at 6:17am |
Hi,
In the past 2 days I've learned that both PHP and ASP.NET can easily retrieve information from remote sites. Finding the sample code wasn't as easy as I expected, especially for ASP.NET - so, I thought it would be useful if I post it here. PHP sample code: <? $file = fopen ("http://www.yahoo.com/", "r"); while (!feof ($file)) { $line = fgets ($file, 1024); echo $line; } fclose($file); ?> ASP.NET sample code: <% dim snw As New System.Net.WebClient() dim data as Byte() data=snw.downloaddata("http://www.yahoo.com") response.write(Encoding.ASCII.GetString(data)) %> Andy Edited by Administrator |
|
Sponsored Links | |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |