Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm building a windows forms app using C#. I have used a picture box (name : pictureBox1) and i'm trying to place images within the box. When i give a local path (i.e path to a image file on my hard-disk), then the program functions fine.
e.g pictureBox1.ImageLocation = "C:\\test.jpg";

But when i give a URL like the following
pictureBox1.ImageLocation = "http://dceqc.files.wordpress.com/2009/06/earth-globe-browse2.jpg";

then the picture does not appear in the picture box.
What can be the problem?
I have .net versions 1.1, 2.0 (SP2), 3.0 and 3.5 installed.
I have a working internet connection and i have tested this program by disabling the firewall and also by enabling it.....but to no avail.
Please help.

Update 1:
When i use pictureBox1.Load(http://dceqc.files.wordpress.com/2009/06/earth-globe-browse2.jpg)
i get an exception "(407) Proxy Authentication Required". How do i work around this?
Posted
Updated 3-Mar-10 17:52pm
v3

1. Does the image exist at that URL? Can you type that URL into your web browser and get the image?

2. Have you tried pictureBox1.Load("http://dceqc.files.wordpress.com/2009/06/earth-globe-browse2.jpg")?

[Update]
The 407 error you are getting means you don't have direct access to that file. You have to log-in to wordpress to get authentication credentials which are passed from wordpress's login server to the file server. You need to host the image file somewhere else.
 
Share this answer
 
v2
Yes, the URL does exist.
As per your advice, when i tried to use pictureBox1.Load("http://dceqc.files.wordpress.com/2009/06/earth-globe-browse2.jpg");

i got the WebExeception "The remote server returned an error: (407) Proxy Authentication Required."

What does this exactly mean. How do i work around this?
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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