vs2013—未解决问题—编写简单的图片下载程序

来源:互联网 发布:人脸识别用什么算法 编辑:程序博客网 时间:2024/05/29 02:43

跟着视频用vs2013写了个下载图片的程序,但是出了问题,由于还没有正式开始学习C#,所以先记录下错误,留待以后解决

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Net;namespace picturedownload{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void buttonSend_Click(object sender, EventArgs e)        {            WebClient client = new WebClient();            client.DownloadFile(textUrl.Text,"download//mybook1.jpg");            label1.Text = "成功下载!";            picImg.Image = Image.FromFile("dowmload//mybook1.jpg");//出错点,暂时找不出错误原因        }        private void label1_Click(object sender, EventArgs e)        {        }    }}

问题:图片能下载,但是无法在窗体内显示。待以后深入学习csharp再回来解决……

出现的问题

将出错代码行注释掉后的结果

0 0