• c# 线程和Invoke互操作万用代码


                thAssist = new Thread(() =>
                {
                    Invoke((ThreadStart)delegate()
                    {
                        ctlProgressBar1.Visible = true;
                        ctlProgressBar1.Start();
                    });
    
                    try
                    {
                        requestPage = WebRequest.Create(uri) as HttpWebRequest;
                        response = requestPage.GetResponse() as HttpWebResponse;
                    }
                    catch (WebException ex)
                    {
    
                    }
                    finally
                    {
                        StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
                        Invoke((ThreadStart)delegate()
                        {
                            textBox1.Text = sr.ReadToEnd();
                            //ctlProgressBar1.Stop();
                            //ctlProgressBar1.Visible = false;
                        });
                    }
                });
                thAssist.Start();
  • 相关阅读:
    理解 Go interface 的 5 个关键点
    volcano networkpolicy
    通过 iptables log 日志追踪 Kubernetes 网络
    Network Policy Enforcement
    calico 容器编排之Kubernetes多租户网络隔离
    Kubernetes的原生多租户解决方案
    第四章 计算机基础知识详解
    vue兄弟组件通信
    vue父子组件通信
    Safari浏览器css兼容
  • 原文地址:https://www.cnblogs.com/sung/p/2825316.html
Copyright © 2020-2023  润新知