我打电话给Process.Start,但它阻塞当前线程。 pInfo = new ProcessStartInfo("C:\\Windows\\notepad.exe");
// Start process
mProcess = new Process();
mProcess.StartInfo = pInfo;
if (mProcess.Start() == false) {
我只是尝试这样做: public class FooJob : IJob
{
public FooJob() { }
public void Execute(JobExecutionContext context)
{
Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
}
有人能解释为什么在下面的代码中使用STA线程时不会引发事件“OnNewMail”?该程序尝试使用Redemption库来拦截传入的邮件。 class Program
{
[STAThread()] // When this line is deleted the application works
static void Main(string[] args)