Thread

threadWithParam = new Thread(new ParameterizedThreadStart(new ThreadTest().ShowMsg));//threadWithParam.Start("this is a param.");

threadWithParam.Start(

thread.Start();

"44444");Thread thread=new Thread(new ThreadStart(new Class11().ShowMsg));

表示在 Thread 上执行的方法的委托方法,ThreadStart不能带参数,ParameterizedThreadStart是2.0中新增的,可以带参数(object类型的)

using System.Threading;

public void ShowMsg()
{
    MessageBox.Show("Message Info.");
}

Thread thread = new Thread(new ThreadStart(ShowMsg));
thread.Start();

//带参数

public void ShowMsg(object msg)
{
    MessageBox.Show(msg.ToString());
}

Thread threadWithParam = new Thread(new ParameterizedThreadStart(new ThreadTest().ShowMsg));
threadWithParam.Start("this is a param.");

最新文章

  1. 移动端开发概览【webview和touch事件】
  2. MongoDB学习笔记(一:常见问题汇总)
  3. haproxy 实现多域名证书https
  4. android 多线程 示例
  5. WORDPRESS 后台500错误解决方法集合
  6. C++沉思录之二——虚函数使用的时机
  7. linux网络编程:select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET(转)
  8. 《SpringMVC数据绑定入门》笔记
  9. android相对布局中控件的常用属性【转】
  10. 判断是否为JSON对象
  11. 2018-2019-2 20189206 Python3学习
  12. uWSGI和Gunicorn
  13. 深度学习原理与框架-Tensorflow基本操作-Tensorflow中的变量
  14. docker基础:dockerfile的介绍
  15. 第六章 图(b1)邻接矩阵
  16. hdu-1150(二分图+匈牙利算法)
  17. java分布式系统开关功能设计(服务升降级)
  18. UOJ #164 【清华集训2015】 V
  19. leetcode difficulty and frequency distribution chart
  20. F4NNIU 版本的标准电阻列表(2018-09-29 更新)

热门文章

  1. 将springboot配置文件中的值注入到静态变量
  2. mybatis批量update,返回行数为-1
  3. [百度之星2014资格赛] Disk Schedule 报告
  4. 5分钟上手TypeScript
  5. DOM操作(一)
  6. Ubuntu 16.04搭建原始Git服务器
  7. laravel的 array 函数
  8. [Git] git shortlog 找出最懒的程序员
  9. hadoop-2.0.0-cdh4.6.0 安装
  10. SQL Server CASE语句中关于Null的处理