+92 332 4229 857 99ProjectIdeas@Gmail.com

Reading A Encoded File (C#.net)




The following code shows you how to read a encoded file, with its corresponding encoded write method. 





using System.IO;
using System.Text;


try
  {

    StreamReader UTF7 = new StreamReader("UTF7.txt", Encoding.UTF7);
    string getUTF7Data = UTF7.ReadToEnd();
    UTF7.Close();

    StreamReader UTF8 = new StreamReader("UTF8.txt", Encoding.UTF8);
    string getUTF8Data = UTF8.ReadToEnd();
    UTF8.Close();

    StreamReader Unicode = new StreamReader("Unicode.txt", Encoding.Unicode);
    string getUnicodeData = Unicode.ReadToEnd();
    Unicode.Close();

    StreamReader UTF32 = new StreamReader("UTF32.txt", Encoding.UTF32);
    string getUTF32Data = UTF32.ReadToEnd();
    UTF32.Close();

  }
   catch (Exception e)
  {
  
       Console.WriteLine(e.Message);
  }

0 comments: