views:

124

answers:

3

Hi,

Is there any sample application source which download the entire web-page in windows mobile.. I mean,in desktop when i do save as,entire webpgae gets saved.Same way i want it to be in windows mobile..

Thanks.

+3  A: 

No, I can't provide sample code, but I guess you'd have to parse the HTML file for included other files and download these as well. As you're only talking about images, I'd try to following for a start:

  1. Download HTML file
  2. Look for <img> tags and parse these for the picture file name
  3. For all the picture file names: download these as well

Please note that this does not yet include background images through CSS.

Thorsten Dittmar
Or images loaded via Javascript. That could be _really_ ugly.
MSalters
Didn't mention JavaScript on purpose. CSS could be ugly to parse, but JS would be a pain... ;-)
Thorsten Dittmar
+1  A: 

If you are looking to download the mobile-version of a webpage, use HTTrack and set the agent string to a mobile device, such as the following:

Opera/9.50 (J2ME/MIDP; Opera Mini/4.0.10031/298; U; en)

If you are trying to save the content of a page to your mobile device for offline browsing, you'll need to scrape the page yourself. There are some libraries out there for dealing with HTML in C# (like Html Agility Pack), but I'm not sure if they are compatible with the compact framework.

jheddings
A: 

I don't have the source code anymore but in the past I have used libcurl for Windows mobile, it is quite easy to use it to download anything http and ftp and of course 'src's of , and and href of .

Murali VP
what is libcurl.. were i get it...how to use
Shadow