save a web page to the "html file" on the server

Hello,
I am a computer engineer. I have a problem with my project .please help me.
I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
please gide me with c#.net or any of languages that you know.

Comments

  • : Hello,
    : I am a computer engineer. I have a problem with my project .please help me.
    : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : please gide me with c#.net or any of languages that you know.
    :
    :
    Check the html file for image and other tags and download the link's.
    Then change the tag's to the right address. I think this is how internet
    explorer does it.

    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • : : Hello,
    : : I am a computer engineer. I have a problem with my project .please help me.
    : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : please gide me with c#.net or any of languages that you know.
    : :
    : :
    : Check the html file for image and other tags and download the link's.
    : Then change the tag's to the right address. I think this is how internet
    : explorer does it.
    :
    : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :

    thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)

  • : : : Hello,
    : : : I am a computer engineer. I have a problem with my project .please help me.
    : : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : : please gide me with c#.net or any of languages that you know.
    : : :
    : : :
    : : Check the html file for image and other tags and download the link's.
    : : Then change the tag's to the right address. I think this is how internet
    : : explorer does it.
    : :
    : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : :
    :
    : thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)
    :
    :
    I don't know. I'm also a C# programmer but I dont know. I recall I saw
    something about that somewhere, but I cant remember where.

    Try to search msdn and maybe you find something.

    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • : : : Hello,
    : : : I am a computer engineer. I have a problem with my project .please help me.
    : : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : : please gide me with c#.net or any of languages that you know.
    : : :
    : : :
    : : Check the html file for image and other tags and download the link's.
    : : Then change the tag's to the right address. I think this is how internet
    : : explorer does it.
    : :
    : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : :
    :
    : thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)
    :
    :

    Use the WebRequest and WebResponse object ...

    http://www.informit.com/guides/content.asp?g=dotnet&seqNum=296&rl=1

  • : : : : Hello,
    : : : : I am a computer engineer. I have a problem with my project .please help me.
    : : : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : : : please gide me with c#.net or any of languages that you know.
    : : : :
    : : : :
    : : : Check the html file for image and other tags and download the link's.
    : : : Then change the tag's to the right address. I think this is how internet
    : : : explorer does it.
    : : :
    : : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : :
    : :
    : : thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)
    : :
    : :
    :
    : Use the WebRequest and WebResponse object ...
    :
    : http://www.informit.com/guides/content.asp?g=dotnet&seqNum=296&rl=1
    :
    :thank you. i used this methods but they bring only html parts from pages not other parts like images.(for example image of home page's google site)

  • : : : : : Hello,
    : : : : : I am a computer engineer. I have a problem with my project .please help me.
    : : : : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : : : : please gide me with c#.net or any of languages that you know.
    : : : : :
    : : : : :
    : : : : Check the html file for image and other tags and download the link's.
    : : : : Then change the tag's to the right address. I think this is how internet
    : : : : explorer does it.
    : : : :
    : : : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : : :
    : : :
    : : : thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)
    : : :
    : : :
    : :
    : : Use the WebRequest and WebResponse object ...
    : :
    : : http://www.informit.com/guides/content.asp?g=dotnet&seqNum=296&rl=1
    : :
    : :thank you. i used this methods but they bring only html parts from pages not other parts like images.(for example image of home page's google site)
    :
    :

    Here is the algorithm you would use:

    [code]
    - Use Webrequest and WebResponse to return HTML
    - Parse all image tags from HTML
    - For Each Image Tag
    - Parse out the src attribute
    - Build a URL to to the image based on the src (http://www.thesite.com/theImage.jpg)
    - Use another webrequest and webresponse to return the image
    - Set the ContentType property of the Webrequest to "images/gif", "images/jpeg", or "images/pjpeg", depending on the image type.
    - Save the Response stream into a GDI+ Image object
    - Use the GDI+ Image object to save the image somewhere
    [/code]


    I've done something like this before to rip over 80,000 images from Clipart.com when I had a one week membership. I figured it was easier than trying to save images one at a time manually.

    NOTE: I used regular expressions to parse out the image tag, since it is much easier than trying to use the slow string functions.

  • : : : : : : Hello,
    : : : : : : I am a computer engineer. I have a problem with my project .please help me.
    : : : : : : I want to implement a web server. my website must get an url from user and show the relevant page. but i dont know how can i save response as a html page on the server ( for display it to the user after manipulating). just like a save option of file menu of the internet explorer.i want to saveing a web page as a html page completely that images of the page also save to the server. i wrote project with c#.net.
    : : : : : : please gide me with c#.net or any of languages that you know.
    : : : : : :
    : : : : : :
    : : : : : Check the html file for image and other tags and download the link's.
    : : : : : Then change the tag's to the right address. I think this is how internet
    : : : : : explorer does it.
    : : : : :
    : : : : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : : : :
    : : : :
    : : : : thanks. but how can i download the image file to my computer(how can i send a request and save it's response to my computer. with which methods?(with c#.net code)
    : : : :
    : : : :
    : : :
    : : : Use the WebRequest and WebResponse object ...
    : : :
    : : : http://www.informit.com/guides/content.asp?g=dotnet&seqNum=296&rl=1
    : : :
    : : :thank you. i used this methods but they bring only html parts from pages not other parts like images.(for example image of home page's google site)
    : :
    : :
    :
    : Here is the algorithm you would use:
    :
    : [code]
    : - Use Webrequest and WebResponse to return HTML
    : - Parse all image tags from HTML
    : - For Each Image Tag
    : - Parse out the src attribute
    : - Build a URL to to the image based on the src (http://www.thesite.com/theImage.jpg)
    : - Use another webrequest and webresponse to return the image
    : - Set the ContentType property of the Webrequest to "images/gif", "images/jpeg", or "images/pjpeg", depending on the image type.
    : - Save the Response stream into a GDI+ Image object
    : - Use the GDI+ Image object to save the image somewhere
    : [/code]
    :
    :
    : I've done something like this before to rip over 80,000 images from Clipart.com when I had a one week membership. I figured it was easier than trying to save images one at a time manually.
    :
    : NOTE: I used regular expressions to parse out the image tag, since it is much easier than trying to use the slow string functions.
    :

    hello
    please explain about this sentenceses.
    - Save the Response stream into a GDI+ Image object
    - Use the GDI+ Image object to save the image somewhere
    thanks a lot.

    :

  • : hello
    : please explain about this sentenceses.
    : - Save the Response stream into a GDI+ Image object
    : - Use the GDI+ Image object to save the image somewhere
    : thanks a lot.
    :
    : :
    :
    :

    Here is a simple sample. Sorry if it is written in Visual Basic. Translation to C# should be a piece of cake.

    [code]
    Imports System.IO
    Imports System.Net
    Imports System.Drawing
    ' ...

    Dim request As WebRequest = WebRequest.Create("http://www.somesite.com/myImage.gif")
    Dim responseStream As Stream
    Dim img As Image

    request.ContentType = "image/gif"
    responseStream = request.GetRequestStream()

    img = Image.FromStream(responseStream)
    img.Save("c:somePath", Imaging.ImageFormat.Gif)
    [/code]

    Basically, this example generates a webrequest for a GIF image and returns a Stream object containing the response. Next, I use a GDI+ Image object to create the image in memory using the FromStream function and pass in the the response stream (Which would be a serious of bytes that make up the GIF image.)

    Then I finally use the Image objects save function, to save it on the hard drive.

    You could easily place this code in a routine and reuse it when you parse out multiple image tags in the HTML stream that is returned from your main program. Of couse you have to use logic to detect if the image is a jpeg, gif, or png in some cases.
  • This way is even easier:

    [code]
    Imports System.Net

    Dim wc As New WebClient
    wc.DownloadFile("http://www.somewebsite.com/myImage.gif", "c:somepathmyImage.gif")
    [/code]
  • : : hello
    : : please explain about this sentenceses.
    : : - Save the Response stream into a GDI+ Image object
    : : - Use the GDI+ Image object to save the image somewhere
    : : thanks a lot.
    : :
    : : :
    : :
    : :
    :
    : Here is a simple sample. Sorry if it is written in Visual Basic. Translation to C# should be a piece of cake.
    :
    : [code]
    : Imports System.IO
    : Imports System.Net
    : Imports System.Drawing
    : ' ...
    :
    : Dim request As WebRequest = WebRequest.Create("http://www.somesite.com/myImage.gif")
    : Dim responseStream As Stream
    : Dim img As Image
    :
    : request.ContentType = "image/gif"
    : responseStream = request.GetRequestStream()
    :
    : img = Image.FromStream(responseStream)
    : img.Save("c:somePath", Imaging.ImageFormat.Gif)
    : [/code]
    :
    : Basically, this example generates a webrequest for a GIF image and returns a Stream object containing the response. Next, I use a GDI+ Image object to create the image in memory using the FromStream function and pass in the the response stream (Which would be a serious of bytes that make up the GIF image.)
    :
    : Then I finally use the Image objects save function, to save it on the hard drive.
    :
    : You could easily place this code in a routine and reuse it when you parse out multiple image tags in the HTML stream that is returned from your main program. Of couse you have to use logic to detect if the image is a jpeg, gif, or png in some cases.
    :

    hello
    thank you very much.
    I received your msg now becuase i had a problem.
    during this time i used an other way. with using binaryReader i read stream and with binaryWriter i write it to a FileStream object. and i succeded.
    but now i should implement your way too. becuase this is better than my way.
    can you say were are you from?
    thanks with regards.

  • : : : hello
    : : : please explain about this sentenceses.
    : : : - Save the Response stream into a GDI+ Image object
    : : : - Use the GDI+ Image object to save the image somewhere
    : : : thanks a lot.
    : : :
    : : : :
    : : :
    : : :
    : :
    : : Here is a simple sample. Sorry if it is written in Visual Basic. Translation to C# should be a piece of cake.
    : :
    : : [code]
    : : Imports System.IO
    : : Imports System.Net
    : : Imports System.Drawing
    : : ' ...
    : :
    : : Dim request As WebRequest = WebRequest.Create("http://www.somesite.com/myImage.gif")
    : : Dim responseStream As Stream
    : : Dim img As Image
    : :
    : : request.ContentType = "image/gif"
    : : responseStream = request.GetRequestStream()
    : :
    : : img = Image.FromStream(responseStream)
    : : img.Save("c:somePath", Imaging.ImageFormat.Gif)
    : : [/code]
    : :
    : : Basically, this example generates a webrequest for a GIF image and returns a Stream object containing the response. Next, I use a GDI+ Image object to create the image in memory using the FromStream function and pass in the the response stream (Which would be a serious of bytes that make up the GIF image.)
    : :
    : : Then I finally use the Image objects save function, to save it on the hard drive.
    : :
    : : You could easily place this code in a routine and reuse it when you parse out multiple image tags in the HTML stream that is returned from your main program. Of couse you have to use logic to detect if the image is a jpeg, gif, or png in some cases.
    : :
    :
    : hello
    : thank you very much.
    : I received your msg now becuase i had a problem.
    : during this time i used an other way. with using binaryReader i read stream and with binaryWriter i write it to a FileStream object. and i succeded.
    : but now i should implement your way too. becuase this is better than my way.
    : can you say were are you from?
    : thanks with regards.
    :
    :

    New York State
  • : This way is even easier:
    :
    : [code]
    : Imports System.Net
    :
    : Dim wc As New WebClient
    : wc.DownloadFile("http://www.somewebsite.com/myImage.gif", "c:somepathmyImage.gif")
    : [/code]
    :
    thank you very much .
    Are you sure that method webclient stores a url on server not on the client????????????????????????????

  • : : This way is even easier:
    : :
    : : [code]
    : : Imports System.Net
    : :
    : : Dim wc As New WebClient
    : : wc.DownloadFile("http://www.somewebsite.com/myImage.gif", "c:somepathmyImage.gif")
    : : [/code]
    : :
    : thank you very much .
    : Are you sure that method webclient stores a url on server not on the client????????????????????????????
    :
    :

    In the context of an ASP.NET page, this will save the downloaded file on the same server in the path specified.

    There would be no way to store it on the clients computer.
  • : : : This way is even easier:
    : : :
    : : : [code]
    : : : Imports System.Net
    : : :
    : : : Dim wc As New WebClient
    : : : wc.DownloadFile("http://www.somewebsite.com/myImage.gif", "c:somepathmyImage.gif")
    : : : [/code]
    : : :
    : : thank you very much .
    : : Are you sure that method webclient stores a url on server not on the client????????????????????????????
    : :
    : :
    :
    : In the context of an ASP.NET page, this will save the downloaded file on the same server in the path specified.
    :
    : There would be no way to store it on the clients computer.
    :
    thanks very much.i hope you will be successful always.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories