Output is not in human readable format when writing content of an Excel sheet to console in C#

Viewed 1988

I'm trying to read an excel sheet and displaying contents to console. the code is here

  FileStream fileStream = new FileStream(@"E:\USERS\MyWorkbook.xlsx", FileMode.Open, FileAccess.Read);
  byte[] byteCode = new byte[fileStream.Length];
  fileStream.Read(byteCode, 0, (int)fileStream.Length);            
  foreach (var byteValue in byteCode)
  {
      Console.Write(Convert.ToChar(byteValue));
  }
  Console.ReadLine();

the output is

PK♥♦¶ ♠ ! bî?h^☺ ?♦ ‼☻[Content_Types].xml ¢♦☻(  ☻

¬?ENA0►E÷HüCä-Jܲ5í?Ç↕*Q>AÄ?ƪc[?iiÿ??û►B¡§j7±↕IÜ{2ñIh²nm¶??Æ»R♀??EAU^←7/>ÅÇ ì%¿↨↓?rZYï ¶←@1↓__?f? ?q·AR4DáAJ¬→h§▬>?a?UÇV◄߯1♀ªZ"9EUAàNV_◄8EcO►aÑ‼Oji){^óa-I♦ ?"{Ü▬v^¥P!XS)bR1rú?K_s(,3O`▬_§ïßeÖ↔♦»ß1æ►@(?a?sí?►[í?☼öB·LA?F←I↔"fKlk↑--¿$♣?A pN$å

What's wrong with it?

3 Answers
Related