Thursday, February 4, 2010

How to write FIle to hard disk

FileStream fs1 = new FileStream(Server.MapPath("aatish.txt"), FileMode.Append,
FileAccess.Write, FileShare.Read);
byte[] data1 = System.Text.Encoding.ASCII.GetBytes("This is an additional string");
fs1.Write(data1, 0, data1.Length);
fs1.Flush();
fs1.Close();

No comments:

Post a Comment