首页

C#下载远程网络文件实例

c#

2020-8-26

下载远程网络文件实例

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string uri = textBox1.Text;
            string LocalFileName = "local.gif";
            System.Net.WebClient client = new System.Net.WebClient();
            client.DownloadFile(uri,LocalFileName);
            this.pictureBox1.Image = Image.FromFile(LocalFileName);
        }
    }
资源下载此资源下载价格为2D币(VIP免费),请先
资源文件列表
╞╒═¿╧┬╘╪/DFile.sln , 905
╞╒═¿╧┬╘╪/DFile.suo , 30720
╞╒═¿╧┬╘╪/DFile/bin/Debug/DFile.exe , 8704
╞╒═¿╧┬╘╪/DFile/bin/Debug/DFile.pdb , 19968
╞╒═¿╧┬╘╪/DFile/bin/Debug/DFile.vshost.exe , 14328
╞╒═¿╧┬╘╪/DFile/bin/Debug/DFile.vshost.exe.manifest , 490
╞╒═¿╧┬╘╪/DFile/bin/Debug/local.gif , 0
╞╒═¿╧┬╘╪/DFile/DFile.csproj , 3756
╞╒═¿╧┬╘╪/DFile/Form1.cs , 704
╞╒═¿╧┬╘╪/DFile/Form1.designer.cs , 3939
╞╒═¿╧┬╘╪/DFile/Form1.resx , 5814
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.csproj.FileListAbsolute.txt , 654
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.csproj.GenerateResource.Cache , 847
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.exe , 8704
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.Form1.resources , 180
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.pdb , 19968
╞╒═¿╧┬╘╪/DFile/obj/Debug/DFile.Properties.Resources.resources , 180
╞╒═¿╧┬╘╪/DFile/Program.cs , 486
╞╒═¿╧┬╘╪/DFile/Properties/AssemblyInfo.cs , 1366
╞╒═¿╧┬╘╪/DFile/Properties/Resources.Designer.cs , 2860
╞╒═¿╧┬╘╪/DFile/Properties/Resources.resx , 5612
╞╒═¿╧┬╘╪/DFile/Properties/Settings.Designer.cs , 1090
╞╒═¿╧┬╘╪/DFile/Properties/Settings.settings , 249
没有账号? 忘记密码?

社交账号快速登录