TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tiger
NA
6
0
System.IO Error - please help
Feb 19 2010 6:38 AM
Hi,
I am trying to write a console application which is watching a particular directory and if a file comes, it works upon it.
It works fine when I execute this in debug mode with lots of file dropped into that directory.
But when I execute it in the run mode it only works for the first file that is dropped in the directory. It does detect that files are coming in but it cannot do anything with them. It throws the following error:
-------------------------------------------------- Error ---------------------------------------------------------------------------------------------
Exception is: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights
, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolea
n bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferS
ize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, I
nt32 bufferSize)
at System.IO.StreamReader..ctor(String path)
----------------------------------------------------------------------------------------------------------------------------
Stack trace shows that it failing (for second file onwards) at the following line of code:
StreamReader reader =
new
StreamReader
(myfilename);
Note that I am doing this in try catch finally block and also calling reader.dispose() in the finally block.
Your help will be much appriciated. Have looked over the internet but have not found a solution.
Regards,
Reply
Answers (
2
)
smtp server installation and tutorial
want to display first row first column in datagrid .......