从Windows应用程序中的URL下载图像 [英] download image from an url in windows application

查看:83
本文介绍了从Windows应用程序中的URL下载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建一个Windows应用程序,其中我有DataTable,其中包含我必须下载到本地系统的文件的URL。我该怎么做..

我使用了WebClient及其DownnloadFileAsyn,但文件没有被下载,也没有错误。任何人都可以帮助



[代表OP粘贴]

Hi,
I am creating a windows applciation where i have DataTable which contains URLS of file i have to download to a local system.. How can i do it..
I used WebClient and its DownnloadFileAsyn but the file is not being downloaded and no error is there . can any one help

[Pasted on behalf of OP]

foreach (DataRow _drDevice in dtDeviceLoogos.Rows)
{
    using (WebClient Client = new WebClient())
    {
        Client.DownloadFile(_drDevice["LogoPath"].ToString(), 
             "D:\\Logos\\_drDevice[""].ToString());
    }
}

推荐答案

http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx [ ^ ]



http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx[^]

WebClient* Client = new WebClient();// or do it like in the link.


这篇关于从Windows应用程序中的URL下载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆