G
Guest
Hello , I have windows service which do listening to specified directory
using FileSystemWatcher , on Created Event and Get all the files in the
directory using Directory.GetFiles function then foreach file in the files
list and passed the file path to a function to read its content then process
it then move it to another directory
am reading each file content using StreamReader...ReadToEnd function, all
process working fine , That when 50 files are copied simultanously there are
no error , but when more than this like 60 or 80 or more a error messages
logged to error log like following
Error in Message Object-> MessageObject.SendMessage() (C:\queue\
26e54303de8e431c81f9e1004c427590.msg) >>The process cannot access the file
"C:\queue\ 26e54303de8e431c81f9e1004c427590.msg" because it is being used by
another process.
How Can I effectively avoid this problem?????
using FileSystemWatcher , on Created Event and Get all the files in the
directory using Directory.GetFiles function then foreach file in the files
list and passed the file path to a function to read its content then process
it then move it to another directory
am reading each file content using StreamReader...ReadToEnd function, all
process working fine , That when 50 files are copied simultanously there are
no error , but when more than this like 60 or 80 or more a error messages
logged to error log like following
Error in Message Object-> MessageObject.SendMessage() (C:\queue\
26e54303de8e431c81f9e1004c427590.msg) >>The process cannot access the file
"C:\queue\ 26e54303de8e431c81f9e1004c427590.msg" because it is being used by
another process.
How Can I effectively avoid this problem?????