473,387 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3556
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: chuck clark | last post by:
Hi, I understand that for security and other reasons that javascript does not support writing/reading to text files. I am looking for a way that will however. This is what i am trying to do. I...
1
by: John | last post by:
I have a Socket open to a target system. I get the network stream from the open socket and then create a stream reader and stream writer on this stream. The stream reader and writers are operating...
0
by: Daniel | last post by:
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...
2
by: Kiran | last post by:
Hi, Can we use network path for reading the file using streamwrite function? The below code is working fine. string strContentsTemp, tmp; StreamWriter objWriter; strContentsTemp =...
4
by: Tim Frawley | last post by:
I am have created a reporting tool for our network to output various information we are interested in like Microsoft Office versioning information and etc. One of the things I have to do is...
0
by: kvarga | last post by:
I have written an Windows Service application, in C#, which calls a web service periodically. This application works fine on a variety of Operating Systems including XP Pro, XP Home, Windows 2000...
0
by: Chrisg | last post by:
Hello, How can I connect to a shared folder/file located on a remote computer in a workgroup environment. I can't use impersonation and LogonUserA() API because that only obtains a local user...
8
by: Marc Gravell | last post by:
I want to write a method that will accept a stream as a parameter, and which will write xml to the stream (based in reality on database results) using the XmlTextWriter class. However, this insists...
2
by: Mikus Sleiners | last post by:
I'm trying to write new stream from string and i can't figure out why my memory stream instance is null after i have writen to it with stream writer. Here is an example. MemoryStream stream =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.