Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
private void button1_Click(object sender, EventArgs e)
        {
            var client = new WebClient();
            string content = client.DownloadString("http://www.w3schools.com/");
            textBox1.Text = content;
        }


then saving the text of textbox1.text=content as html file.It's working and open as a web page, but problem is,if there are any images then not working,at the place of image there is small cross symbol.

So i want ur help, how can i download the images and other content also and link it to their place,to show it in proper format as webpage looks on net. (like we save any page and use it as a offline)

one thing i m not using website project, i m working through c# windows.

help
Posted
Updated 5-Nov-12 20:50pm
v3

you can use http://www.httrack.com/page/2/[^]
download it. and you can download full website.
 
Share this answer
 
Comments
bbirajdar 6-Nov-12 1:49am    
What is 'wanna' ?
AdityaPratapSingh 6-Nov-12 1:51am    
he want to say
"i want learn 'How to download whole web page contents including images even from inside JavaScripts without using third party dll.' in c#"
StackQ 6-Nov-12 2:06am    
right
 
Share this answer
 
Comments
StackQ 6-Nov-12 1:49am    
here logic is same as i m doing, and one thing,it's bye asp-net. plz yr give right answer only mention in my question heading (using c#)
C#
public static void DownloadFile(string remoteFilename, string localFilename)
{
    WebClient client = new WebClient();
    client.DownloadFile(remoteFilename, localFilename);
}
 
Share this answer
 
Comments
StackQ 6-Nov-12 2:16am    
here remotefile=http://www.w3schools.org//
and localfilename=application.startupath+myfile.html

can i assign them like this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900