C#中简单实现多线程
来源:互联网 发布:长春网络营销策划 编辑:程序博客网 时间:2024/06/16 04:32
感觉用C#进行开发就是快
using System;
using System.Threading;
namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
Thread thread1 = new Thread(new ThreadStart(Method1));
Thread thread2 = new Thread(new ThreadStart(Method2));
thread1.Start();
thread2.Start();
}
public static void Method1()
{
while(true)
{
Console.WriteLine("this is thread : 1");
Thread.Sleep(1000);
}
}
public static void Method2()
{
while (true)
{
Console.WriteLine("this is thread : 2");
Thread.Sleep(1520);
}
}
}
}
- C#中简单实现多线程
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- 在C#中编写多线程应用程序,简单!
- C#中不同类timer实现多线程
- 多线程中线程池的简单实现
- c++中实现多线程的简单实例
- c#简单的多线程
- C#简单的多线程
- C#多线程简单实例
- C#简单多线程方法
- C#简单多线程Demo
- C#中简单索引器的实现
- c#中多线程---使用多线程
- ASP和C#隐藏文件下载路径的方法
- 谈谈C#中的事件注册和注销
- C#+Windows API操纵系统菜单
- c#实现google样式的分页
- ASP.NET 2.0 中的代码隐藏和编译
- C#中简单实现多线程
- C#中稳定的socket收发实现:agsxmpp的ClientSocket实现
- 转载-Oracle数据库的导出和导入
- 编译原理课程设计---用java写的SNLCompiler(简单嵌套语言SNL的编译程序)
- 函数的参数最好采用引用方式读入
- HTTP/1.1 的连接分析
- 关于变形的背包问题的答案(C版)
- 买书,工资,臭脚丫
- S60中文模拟器的问题