if(i==1)
{
FileStream fs = new FileStream(ConfigurationClass.ServerClass.ChoiceSavePath()+"\\报告.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("家庭成员总数超过12人!");
sw.Close();
}
报了这样的错:
在可以调用 OLE 之前,必须将当前线程设置为单线程单元(STA)模式。请确保您的 Main 函数带有 STAThreadAttribute 标记。 只有将调试器附加到该进程才会引发此异常
Main 函数有 STAThreadAttribute e
请问还能是什么原因