title: How To Display Computer Name in razor component
body: <p>I try to display my computer name in razor component with this way:</p>
  <pre><code>@page &quot;/home&quot;
  
  @using System;
  @using System.Net;
  
  &lt;h2&gt;The Computer name is: @PcName&lt;/h2&gt;
          
   @code
  {
    string PcName = Environment.MachineName.ToString();
  }
  </code></pre>
  <p>But the output is The Computer name is:emscripten.
  How can i display my computer name in razor component.</p>
  <p>Thank you in advance.</p>