0
我在我的项目中有一些代码,如下所示,这里STA线程的用法是什么? 我对STA的了解是单线程公寓,它只在使用COM组件时才需要,它在应用程序的主要条目中使用。窗口应用程序中的STA线程
/// <summary>
/// The main entry point for the application.
///
/// Command line:
/// Leaf.exe /s server-name
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.DoEvents();
Application.Run(new Leaf()); // Leaf is a constructor
}
这可能会帮助你http://stackoverflow.com/questions/127188/could-you-explain-sta-and-mta – 2011-03-23 07:43:49