Friday, May 1, 2015

asp.net Write To File

   public static void WriteToFile(string inputText, string absoluteFilePath)
        {
            try
            {
                FileStream fs = new FileStream(absoluteFilePath, FileMode.Create, FileAccess.Write);
                StreamWriter sw = new StreamWriter(fs);
                sw.Write(inputText);
                sw.Close();
                fs.Close();
            }
            catch { }
        }

No comments:

Post a Comment