Displaying a GIF File from a URI Location

  • Thread starter Thread starter Guest
  • Start date Start date
Hello,

Thanks for your post. I agree with Klaus that you should download the GIF
with the specified URI to a local file. Please use the
WebClient.DownloadFile method:

WebClient.DownloadFile Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemnetwebclientclassdownloadfiletopic.asp

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
I wasn't able to open your link. Can you provide some sample code on
how to download the file?

Jason Carter
 
Hello Jason,

Thanks for your reply. Please refer to the following code snippet:

//---------------code snippet--------------
string remoteUri = "http://www.contoso.com/library/homepage/images/";
string fileName = "ms-banner.gif", myStringWebResource = null;
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = remoteUri + fileName;
Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n",
fileName, myStringWebResource);
// Download the Web resource and save it into the current filesystem folder.
myWebClient.DownloadFile(myStringWebResource,fileName);
//----------------end of--------------------------

In addition, I double checked the link in my previous email, it works. It
may be wrapped to two lines on your side.

I am standing by for your result.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top