469,631 Members | 982 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 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

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
2 3205
Daniel,

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

Thanks in advance

Cor
Sep 8 '05 #2
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.

Similar topics

6 posts views Thread by chuck clark | last post: by
2 posts views Thread by Kiran | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.