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

简单图片下载

大滑稽11年前 (2014-03-24).NET1223

 

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://wpers.net/post/61.html

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

Linq读写XML

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

修改注册表限制软件使用次数

 private void Form1_Load(object sender, System.EventArgs e){RegistryKey RootKey,RegKey; //项名为:HKEY_CURRENT_USER\So...

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();...

以ToolStrip为例绘制简便背景

//以ToolStrip为例绘制简便背景e.Graphics.FillRectangle(new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.Point(...