2019년 8월 30일 금요일

[C#/Mono] Net


wNet.cs



using System;
using System.Net;

public class WNet
{
 public WNet() {
 }

 private void httpGet(string url, string fileName) {
  //"http://www.sayka.com/downloads/front_view.jpg"
  //"D:\\Images\\front_view.jpg"
  using( WebClient wc = new WebClient() ) {
   wc.DownloadProgressChanged += wc_DownloadProgressChanged;
   wc.DownloadFileAsync(new System.Uri(url), fileName );
  }
 }
 
 void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) {
  //progressBar.Value = e.ProgressPercentage;
  System.Console.WriteLine( e.ProgressPercentage );
 } 
}

댓글 없음:

댓글 쓰기