if you are programming those programs involved, create/WaitOne a named Mutex (which is valid across process boundaries) before writing to the file, seehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemThreadingMutexClassctorTopic.asp
线程的话用 lock,进程的话在操作文件时设置文件对象为 FileShare.Read而如果多个同样的进程可能会并发,那么你可以用 try 然后捉 ex 再 thread.sleep
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货