using System;
using System.ComponentModel;
using System.Net;
using UnityEngine;
public class TestDownloadBehaviour_http : MonoBehaviour
{
public string RemoteFileURI;
public string SaveFilePath;
// Start is called before the first frame update
void Start()
{
DownloadFile();
}
// Update is called once per frame
void DownloadFile()
{
using (WebClient wc = new WebClient())
{
try
{
wc.Proxy = null;
Uri address = new Uri(RemoteFileURI);
//调用DownloadFile方法下载文件
// wc.DownloadFile(textBox1.Text.ToString(), textBox2.Text.ToString());
//调用DownloadFileAsync异步下载文件
wc.DownloadFileAsync(address, Application.dataPath + "/" + SaveFilePath);
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(OnDownlo