forum

home / developersection / forums / write to the file system in a directory

Write to the file system in a directory

Anonymous User 2471 07-Oct-2013

I would like to write to the file system in a directory C: \ directory name, for the moment I have this code:

if (! System.IO.File.Exists (HttpContext.Current.Server.MapPath (filename)))

{
   TXTFile = new System.IO.StreamWriter (HttpContext.Current.Server.MapPath (filename));
}
else
{
   TXTFile = System.IO.File.AppendText (HttpContext.Current.Server.MapPath (filename));
}


but in this way writes on the application folder. How to fix it?


c# c# 
Updated on 08-Oct-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By