473,394 Members | 1,752 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,394 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 3559
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: 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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.