以下に示すようなコードがプロジェクトに少しありますが、STA スレッドの使用法は何ですか? STA について私が知っているのは、シングル スレッド アパートメントであり、COM コンポーネントを使用する場合にのみ必要であり、アプリケーションのメイン エントリで使用されるということです。
/// <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
}