|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Saving a JPG from the web to local diskI have an http command such as http://<ip-Address>/getimage to get a jpg
snapshot image from an IP camera. When I put this into a Web browser it shows the image OK. What I would like to go is to build some VB.Net to be able to save this image to disk. I thought of using a Picturebox as this can show web based images but saving them to disk becomes rather complicated. Is there any other way? -Jerry "Jerry Spence1" <jerry.spe***@somewhere.com> kirjoitti viestissä:446a2f19$0$97611$ed261***@ptn-nntp-reader01.plus.net...>I have an http command such as http://<ip-Address>/getimage to get a jpg Maybe something like>snapshot image from an IP camera. When I put this into a Web browser it >shows the image OK. > > What I would like to go is to build some VB.Net to be able to save this > image to disk. I thought of using a Picturebox as this can show web based > images but saving them to disk becomes rather complicated. Is there any > other way? Dim Client As System.Net.WebClient = New System.Net.WebClient() Client.DownloadFile("http://www.example.com/image.jpg", "c:/image.jpg") should do. Didn't test it though.
Show quote
Hide quote
"cSharpLess" <no@mails.invalid> wrote in message Thanks for this. Worked a treat. Very useful!news:uevFHmSeGHA.3888@TK2MSFTNGP04.phx.gbl... > > "Jerry Spence1" <jerry.spe***@somewhere.com> kirjoitti > viestissä:446a2f19$0$97611$ed261***@ptn-nntp-reader01.plus.net... >>I have an http command such as http://<ip-Address>/getimage to get a jpg >>snapshot image from an IP camera. When I put this into a Web browser it >>shows the image OK. >> >> What I would like to go is to build some VB.Net to be able to save this >> image to disk. I thought of using a Picturebox as this can show web based >> images but saving them to disk becomes rather complicated. Is there any >> other way? > > Maybe something like > > Dim Client As System.Net.WebClient = New System.Net.WebClient() > Client.DownloadFile("http://www.example.com/image.jpg", "c:/image.jpg") > > > should do. Didn't test it though. > -Jerry >> Maybe something like Actually I'm not quite out of problems. I'm getting an error:>> >> Dim Client As System.Net.WebClient = New System.Net.WebClient() >> Client.DownloadFile("http://www.example.com/image.jpg", "c:/image.jpg") >> >> >> should do. Didn't test it though. >> > Thanks for this. Worked a treat. Very useful! > > -Jerry > > "The server committed an HTTP protocol violation" My exe file is Housekeeper 5.0.exe and I understand I need to produce a file called Housekeeper 5.0.exe.config containing the following: <?xml version="1.0" encoding="utf-8" <configuration> <system.net> <settings> <httpWebRequest useUnsafeHeaderParsing="true" /> </settings> </system.net> </configuration> I have placed this in the project folder (is that right?) but I still get the error message. Do I need to load it or anything, or just leave it in the folder? Have I done everything right? -Jerry "Jerry Spence1" <jerry.spe***@somewhere.com> schrieb: 'WebClient.DownloadFile'.>I have an http command such as http://<ip-Address>/getimage to get a jpg > snapshot image from an IP camera. When I put this into a Web browser it > shows the image OK. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> On Tue, 16 May 2006 20:59:20 +0100, "Jerry Spence1"
<jerry.spe***@somewhere.com> wrote: >I have an http command such as http://<ip-Address>/getimage to get a jpg Yet, another option:>snapshot image from an IP camera. When I put this into a Web browser it >shows the image OK. > >What I would like to go is to build some VB.Net to be able to save this >image to disk. I thought of using a Picturebox as this can show web based >images but saving them to disk becomes rather complicated. Is there any >other way? > >-Jerry > My.Computer.Network.DownloadFile("http://SomeDomain/Some.jpg", _ "c:/SomeFolder/Some.jpg") There are 9 other overrides to this to this to handle such things as credentials, overwrite etc. Gene
Show quote
Hide quote
"gene kelley" <o***@by.me> wrote in message I tried this but 'My' wasn't defined. Where does it come from?news:qnnk62l0o8gbcv1cuoivtlajkvqa4s6hf8@4ax.com... > On Tue, 16 May 2006 20:59:20 +0100, "Jerry Spence1" > <jerry.spe***@somewhere.com> wrote: > >>I have an http command such as http://<ip-Address>/getimage to get a jpg >>snapshot image from an IP camera. When I put this into a Web browser it >>shows the image OK. >> >>What I would like to go is to build some VB.Net to be able to save this >>image to disk. I thought of using a Picturebox as this can show web based >>images but saving them to disk becomes rather complicated. Is there any >>other way? >> >>-Jerry >> > Yet, another option: > > My.Computer.Network.DownloadFile("http://SomeDomain/Some.jpg", _ > "c:/SomeFolder/Some.jpg") > > There are 9 other overrides to this to this to handle such things as > credentials, overwrite etc. > > Gene -Jerry On Wed, 17 May 2006 06:03:53 +0100, "Jerry Spence1"
<jerry.spe***@somewhere.com> wrote: Show quoteHide quote > My Namespace >> introduced in VS2005. You must be using an earlier>"gene kelley" <o***@by.me> wrote in message >news:qnnk62l0o8gbcv1cuoivtlajkvqa4s6hf8@4ax.com... >> On Tue, 16 May 2006 20:59:20 +0100, "Jerry Spence1" >> <jerry.spe***@somewhere.com> wrote: >> >>>I have an http command such as http://<ip-Address>/getimage to get a jpg >>>snapshot image from an IP camera. When I put this into a Web browser it >>>shows the image OK. >>> >>>What I would like to go is to build some VB.Net to be able to save this >>>image to disk. I thought of using a Picturebox as this can show web based >>>images but saving them to disk becomes rather complicated. Is there any >>>other way? >>> >>>-Jerry >>> >> Yet, another option: >> >> My.Computer.Network.DownloadFile("http://SomeDomain/Some.jpg", _ >> "c:/SomeFolder/Some.jpg") >> >> There are 9 other overrides to this to this to handle such things as >> credentials, overwrite etc. >> >> Gene > >I tried this but 'My' wasn't defined. Where does it come from? > >-Jerry > version. I'm not familiar with the older versions as to what to use in that case. Gene > My Namespace >> introduced in VS2005. You must be using an earlier Have a look at the message from Herfried,> version. > I'm not familiar with the older versions as to what to use in that > case. > Cor > Yes I am. Thanks. Good incentive to upgrade!> My Namespace >> introduced in VS2005. You must be using an earlier > version. > I'm not familiar with the older versions as to what to use in that > case. > > Gene -Jerry
Byte to Chr - not correctly translated!!
GetDefaultPrinter VB.NET Windows Service Question (Timing) How Do I Put An End Of Line Character In A TextBox User Software Settings and System Software Settings in Windows Regsitry Dynamically Create Timers are Run-Time VB Express - How to access query value on my form? VS2003 and VS2005 Side by Side Confusion over namespaces CSV file reading every other record... |
|||||||||||||||||||||||