IO Exception: directory name is invalid using directory from File System Watcher OnChanged Event
- by Bi
My C# application throws a System.IO.IOExcepton (The directory name is invalid) for the following code for implementing a filewatcher:
public void OnChanged(object source, FileSystemEventArgs e)
{
DirectoryInfo dList = new DirectoryInfo(e.FullPath);
FileInfo[] TxtFiles = dList.GetFiles("*.TXT");
}
e.FullPath is "C:/Documents and Settings/Bi/Application Data/TestApp/Reports\\0MA01P62240_000005798_TRI_4947712701738551.TXT".
If you notice it seems to append a "\\" to the path when it tracks the file. Any idea what the problem may be?