title: How to read .xlsx file in cshtml(razor with c#)
body: <p>I need to read a excel(.xlsx) file in my website.
  I already have implemented for .csv files(it was easy as it is comma delimiter file).
  So can you just suggest the change so that I can implement it for excel file(.xlsx).
  My code:</p>
  
  <pre><code>@{
  var result = "";
  Array userData = null;
  char[] delimiterChar = {','};
  
  var dataFile = Server.MapPath("~/App_Data/data.csv");
  
  if (File.Exists(dataFile)) {
      userData = File.ReadAllLines(dataFile);
      if (userData == null) {
          // Empty file.
          result = "The file is empty.";
      }
  }
  else {
      // File does not exist.
      result = "The file does not exist.";
  }
  }
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Reading Data from a File&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
      &lt;h1&gt;Reading Data from a File&lt;/h1&gt;
      @result
      @if (result == "") {
          &lt;ol&gt;
          @foreach (string dataLine in userData) {
          &lt;li&gt;
              User
              &lt;ul&gt;
              @foreach (string dataItem in dataLine.Split(delimiterChar)) {
                  &lt;li&gt;@dataItem&lt;/li &gt;
              }
              &lt;/ul&gt;
          &lt;/li&gt;
          }
          &lt;/ol&gt;
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>