Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to Save a Webpage as a local file in ASP.net ?

Reply
Thread Tools

How to Save a Webpage as a local file in ASP.net ?

 
 
Kylin
Guest
Posts: n/a
 
      05-16-2005
How to Save a Webpage as a local file in ASP.net,
eg .http://www.asp.net/Default.aspx?tabindex=0&tabid=1 ,
how to save this page as a local file named by myself ?
any document about this ?

--
FireCrow Studio
Kylin Garden
ICQ:156134382


 
Reply With Quote
 
 
 
 
SCDeveloper
Guest
Posts: n/a
 
      05-16-2005
Scrape the content from an URL and save it to a file.

In the following example, it outputs to a label.

<%@ Import Namespace="System.Net" %>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
'STEP 1: Create a WebClient instance
Dim objWebClient as New WebClient()


'STEP 2 and 3
Const strURL as String = "http://www.sharingcorner.com/"
Dim objUTF8 as New UTF8Encoding()
lblHTMLOutput.Text =
objUTF8.GetString(objWebClient.DownloadData(strURL ))
End Sub
</script>

<html>
<body>
<h1>Screen Scrape of www.sharingcorner.com</h1>
<p>
<asp:label id="lblHTMLOutput" runat="server" />
</body>
</html>


SCDeveloper
http://www.sharingcorner.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save a webpage contents to a file ( with LWP ) Jack Perl Misc 6 02-21-2008 12:50 AM
Clipping a remote webpage with Javascript/XPath and including in a "local" webpage soren625 Javascript 2 12-12-2006 02:09 PM
check if a webpage is forwarding to a other webpage martijn@gamecreators.nl Python 1 09-06-2005 02:27 PM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
Automatically save a webpage as a text file Chris Petersen Perl Misc 4 08-21-2003 02:23 AM



Advertisments