472,117 Members | 2,626 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 16135
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
reply views Thread by leo001 | last post: by

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.