这种情况是由多线程引起的,在项目中遇到过这样的情况,查了一下网上的解决方法...汗,都不行。只有靠自己了!
首先在 static void main() 函数前加上 [stathreadattribute]
然后在新建线程的那个函数
thread t = new thread(new threadstart(flymessage));//新建了一个线程
t.apartmentstate = apartmentstate.sta;//加上这句话!
t.start();//开始线程
现在ok了~~再试试,goodluck~~