473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Copying a jpg from a http web page using C#

Is there any way of accessing and copying a JPG from a web page using C#.

I have tried using WebRequest but I don't know what to do this the
WebResponse, and I have
tried using WebClient but I cet a proxey error?

Any suggestions.
Nov 15 '05 #1
9 2288
You should look into System.Web.HttpRequest. Construct and post a request
and process the response appropriately.

-vJ

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
Is there any way of accessing and copying a JPG from a web page using C#.

I have tried using WebRequest but I don't know what to do this the
WebResponse, and I have
tried using WebClient but I cet a proxey error?

Any suggestions.

Nov 15 '05 #2
Thanks,

But when I try 'using System.Web;' The compiler complains that it can't
find it?

Any suggestions?
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
You should look into System.Web.HttpRequest. Construct and post a request
and process the response appropriately.

-vJ

Nov 15 '05 #3
Thanks,

But when I try 'using System.Web;' The compiler complains that it can't
find it?

Any suggestions?
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
You should look into System.Web.HttpRequest. Construct and post a request
and process the response appropriately.

-vJ

Nov 15 '05 #4

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:On**************@tk2msftngp13.phx.gbl...
Thanks,

But when I try 'using System.Web;' The compiler complains that it can't
find it?

Any suggestions?
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
You should look into System.Web.HttpRequest. Construct and post a request and process the response appropriately.

-vJ



references --> right click --> add refrerence --> system.web.dll or
something like that
Nov 15 '05 #5
Thanks, that worked, although I am a bit unsure of what to do next?

i.e. How do I construct and post a request
and process the response appropriately.

In order to copy a jpg from a wec page?
Nov 15 '05 #6

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:On**************@tk2msftngp13.phx.gbl...
Thanks,

But when I try 'using System.Web;' The compiler complains that it can't
find it?

Any suggestions?
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:Om**************@TK2MSFTNGP09.phx.gbl...
You should look into System.Web.HttpRequest. Construct and post a request and process the response appropriately.

-vJ



references --> right click --> add refrerence --> system.web.dll or
something like that
Nov 15 '05 #7
Thanks, that worked, although I am a bit unsure of what to do next?

i.e. How do I construct and post a request
and process the response appropriately.

In order to copy a jpg from a wec page?
Nov 15 '05 #8
void GetImage()
{
System.Net.WebRequest request =
System.Net.WebRequest.Create("http://www.microsoft.com/homepage/gif/bnr-micr
osoft.gif");
System.Net.WebResponse response = request.GetResponse();

System.Drawing.Bitmap bmp = new
System.Drawing.Bitmap(response.GetResponseStream() );
bmp.Save("c:\\msft.gif", System.Drawing.Imaging.ImageFormat.Gif);
bmp.Dispose();
response.Close();
}

-vJ

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
Thanks, that worked, although I am a bit unsure of what to do next?

i.e. How do I construct and post a request
and process the response appropriately.

In order to copy a jpg from a wec page?

Nov 15 '05 #9
Thanks a million, that is really healpfull. Just out of interest do you
know of any good books on this sort of subject?

Best regards,

Duncan.
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
4
by: Alex Vinokur | last post by:
Copying files : input to output =============================== C/C++ Performance Tests ======================= Using C/C++ Program Perfometer http://sourceforge.net/projects/cpp-perfometer...
3
by: Tjerk Wolterink | last post by:
Hello i have xml code like this: <page:page xmlns:page="namespacefor page"> <page:section> <page:header> <b>Hello</b>There </page:header> <page:content> --- HTML CODE like: <i>Y</i>es i...
1
by: Sarah | last post by:
Hi, Can someone please tell me if there's a way to copy image files from one server to another using ASP and FSO? Or perhaps some other way to do it? I'm trying to collect information on...
22
by: Matt | last post by:
When browsing a web page a user has the ability to highlight content on a page (by holding down the left mouse button and dragging the mouse over the desired content). Is there a way to disable...
1
by: Hakan | last post by:
I am regularly downloading an asp web page and what I want to do is to do it automatically The web page consists of one main page and many linked pages to it. Firstly I am selecting the whole page...
48
by: mantrid | last post by:
Hello Is there a way to prevent users copying a full size image from a web page. Displaying the image with a smaller width and height only affects the image as viewed, the actual full size image...
9
by: Jess | last post by:
Hello, I tried to clear a vector "v" using "v.clear()". If "v" contains those objects that are non-built-in (e.g. string), then "clear()" can indeed remove all contents. However, if "v"...
7
freddieMaize
by: freddieMaize | last post by:
Hi, my first day in designing. Since I’m not a very good designer I tried copying a template from the net. Below is my problem. I saved the below web page,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.