Writing string content to a file
This code describes how to write content to a file
StringBuilder stringData = new StringBuilder();
stringData= "Any String Content.It may be custom built XML String/Web method Call etc..,";
FileStream fs = new FileStream("Complete File Path", FileMode.Create);
byte[] buffer = new byte[stringData.Length];
for (int i = 0; i < stringData.Length; i++)
{
buffer[i] = (byte)stringData[i];
}
fs.Write(buffer, 0, buffer.Length);
fs.Close();