none
streamwriter RRS feed

  • Question

  • hi,I have created a file and now I want to write in the file.
    how can I choose the font I want for writing?


    StreamWriter

    sw = File.CreateText("E:\\test\\a.txt");

     

    sw.WriteLine(

    "Hello");

    Tuesday, January 26, 2010 11:54 AM

Answers

  • Text files have no embedded font style...it is just plain text.

    Also, I might suggesting utilizing the "using" statement for things that must be closed (files/connections/etc):
    using(StreamWriter sw = File.CreateText(@"E:\test\a.txt"))
    {
         //Do Work
    }

    • Proposed as answer by Harry Zhu Friday, January 29, 2010 8:08 AM
    • Marked as answer by Harry Zhu Monday, February 1, 2010 3:20 AM
    Tuesday, January 26, 2010 12:55 PM

All replies