1.后台代码
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;
namespace WindowsFormsApplication1
{
public partial class Downfiles : Form
{
public Downfiles()
{
InitializeComponent();
}
private void btndown_Click(object sender, EventArgs e)
{
DownloadFile("http://localhost:3818/Images/力软Doc.rar", @"D:\20190107_力软Doc.rar", progressBar1, label1);
}
public void DownloadFile(string URL, string filename, System.Windows.Forms.ProgressBar prog, System.Windows.Forms.Label label1)
{
float percent = 0;