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?


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




    Tuesday, January 26, 2010 11:54 AM


  • Text files have no embedded font 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