469,954 Members | 1,835 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

Stream writer in c#

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 = this.TextBoxHttpFetch.Text;
tmp = "C:\\temp:\\xyz.cfg"
objWriter = new StreamWriter(SGMSDashBoardConstants.HttpFetchLocat ion );
objWriter.Write(strContentsTemp);
objWriter.Close();
objWriter = null;
Can I use

tmp="\\\\15.220.108.44\\c$\\abc\\xyz\\test.cfg" in the above code?

Please explain how to access remote files. Assume the directory is shared.

Thanks in advance.

Regards.
Nov 16 '05 #1
2 16037
Hi Kiran,

You can local or network paths with StreamWriter

StreamWriter sw = new StreamWriter("\\\\15.220.108.44\\c$\\abc\\xyz\\tes t.cfg");

or

StreamWriter sw = new StreamWriter(@"\\15.220.108.44\c$\abc\xyz\test.cfg ");

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Hi,

Did u try it before posting?

It should work fine.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kiran" <ki**************@yahoo.com> wrote in message
news:9d**************************@posting.google.c om...
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 = this.TextBoxHttpFetch.Text;
tmp = "C:\\temp:\\xyz.cfg"
objWriter = new StreamWriter(SGMSDashBoardConstants.HttpFetchLocat ion );
objWriter.Write(strContentsTemp);
objWriter.Close();
objWriter = null;
Can I use

tmp="\\\\15.220.108.44\\c$\\abc\\xyz\\test.cfg" in the above code?

Please explain how to access remote files. Assume the directory is shared.

Thanks in advance.

Regards.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by JG | last post: by
5 posts views Thread by andrewcw | last post: by
1 post views Thread by Martin | last post: by
reply views Thread by a | last post: by
1 post views Thread by Ryan Ternier | last post: by
7 posts views Thread by .... | last post: by
10 posts views Thread by John Kraft | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.