请教两个程序同时读写文本文件出错问题! 分别写了两个程序,一个程序向txt文件写数据,另一个程序向同一个txt文件读数据。 *********************** 线程编程 初始化:A线程(主线程),B线程 ![]() using System.Threading; private void MainProcess() { ThreadStart threadMethod = new ThreadStart(); Thread B = new Thread(threadMethod(SetValue)); thread.Start(); B.join(); //后面可以继续写A线程的东西,B执行完了会再回来的。 } private void SetValue() { //B线程要做的事情 } 希望大家能用到。 |
|