zoukankan      html  css  js  c++  java
  • 网络通信

                //DownloadProgressChanged

                //DownloadStringCompleted 

                //OpenReadCompleted

                //OpenWriteCompleted

                 //UploadProgressChanged

                 //UploadStringCompleted

                 //  WriteStreamClosed

     

               // DownLoadStringAsnc

                //OpenReadAsync

                //UpLoadStringAsync

                //OpenWriteAsync

                WebClient client = new WebClient();

                if (client.IsBusy)

                    client.CancelAsync();

                client.OpenReadCompleted+=new OpenReadCompletedEventHandler(client_OpenReadCompleted);

                client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);

                client.OpenReadAsync(new Uri("path"));

     

            }

            private void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)

            {

                BitmapImage bitmap = new BitmapImage();

                bitmap.SetSource(e.Result);

                Image1.Source = bitmap;

             

            }

            private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)

            {

                int percent = e.ProgressPercentage;

                long recieve = e.BytesReceived;

                long total = e.TotalBytesToReceive;

     

            }

  • 相关阅读:
    java web开发小记(5)
    java web开发小记(4)
    java web开发小记(3)
    java web开发小记(2)
    java web开发小记(1)
    Myeclipse10小记
    jackson 转换 yyyy-MM-dd格式 少了一个小时问题解决(仅限中国)
    mysql,给每一条数据的某一个字段生成不同的随机数
    mybatis 表情存储报错问题解决
    spring cloud jackson 枚举json互转 枚举json序列化/反序列化
  • 原文地址:https://www.cnblogs.com/lifeOfIT/p/2528875.html
Copyright © 2011-2022 走看看