By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

when i use stream writer to write to a shared folder, and the network card of that remote computer is disabled

P: n/a
when i use stream writer to write to a shared folder, and the network card
of that remote computer is disabled in the middle of the write then
reenabled later. every time i try to write to that same path on the network
drive it says "The process cannot access the file "\\foo\bar.txt" because it
is being used by another process. its not until i restart my exe that it can
access it. I tried catching the error and closing the file when the network
card on the remote machine is disconnected but it fails to close the
connection and gets stuck in this bad state even when the network card of
the remote machine is reconnected. I know its a problem with how i am using
System.IO.StreamWriter because when i restart my whole exe it frees up what
ever hold it had on that path and continues ok.

System.IO.StreamWriter fr = new System.IO.StreamWriter(strTempPath, false);
fr.Write(onehunderedmbstring);
fr.Close();
Sep 8 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Daniel,

Will you be so kind to sent not three messages with almost the same problem.

Thanks in advance

Cor
Sep 8 '05 #2

P: n/a
no

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Daniel,

Will you be so kind to sent not three messages with almost the same problem.
Thanks in advance

Cor

Sep 8 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.