当前位置:首页 >.NET > 正文内容

简单图片下载

大滑稽11年前 (2014-03-24).NET1251
private void StartDownload(string URL, string filename)
{
try
{
WebRequest myre = WebRequest.Create(URL);
}
catch (WebException exp)
{
MessageBox.Show(exp.Message, "Error");
}
 
try
{
WebClient client = new WebClient();
client.DownloadFile(URL, filename + ".jpg");
}
catch (WebException exp)
{
MessageBox.Show(exp.Message, "Error");
}
}

扫描二维码推送至手机访问。

版权声明:本文由第★一★次发布,如需转载请注明出处。

本文链接:http://www.wpers.net/post/61.html

“简单图片下载” 的相关文章

Cbo控件数据源绑定

 //Cbo控件数据源绑定DataTable DtType = noteType.GetTypeList("");         ...

C#遍历控件的方法

首先,要想遍历,就必须找到你想找的表单里面的所有控件,然后一个个的逐一比对,当找到了你需要的控件的时候,再做你需要的操作。1、foreach方法foreach (Control control in ...

Linq读写XML

         private List<News> GetNews(string html)    &n...

c#中分页显示数据

     //c#中分页显示数据    public partial class Form1 : Form    {  ...

C#修改浏览器主页

string key = @"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main";      &n...

C#获得程序集

 //获得程序集System.Reflection.Assembly assem = System.Reflection.Assembly.GetExecutingAssembly();...