私のファイル ウォッチャー イベントは最初のファイルのみを読み取り、次のエラーが表示されます。別のプロセス。」
これが私のコードです:
int? msgID;
string dup ="";
try
{
//---------read from file------------
string block;
using (StreamReader sr = File.OpenText(MsgsPath + "\\" + e.Name))
{
block = sr.ReadToEnd();
}
「使用」は、開閉を自動的に処理する必要がありますよね?次に、このコードを使用して、処理されたファイルを移動します。
File.Move(MsgsPath + "\\" + e.Name, MsgsPath + "\\Archive\\" + e.Name);