Asp.net mvc 4 如何显示服务器进程的标识

Asp.net mvc 4 如何显示服务器进程的标识,asp.net-mvc-4,razor,Asp.net Mvc 4,Razor,我想获取服务器进程的标识。这是一个MVC4/Razor项目。这就是我所拥有的: @using System.Diagnostics <div> The identity running this view is @Thread.CurrentPrincipal.Identity </div> @使用System.Diagnostics 运行此视图的标识为@Thread.CurrentPrincipal.identity 但是我得到一个

我想获取服务器进程的标识。这是一个MVC4/Razor项目。这就是我所拥有的:

@using System.Diagnostics
    <div>
         The identity running this view is @Thread.CurrentPrincipal.Identity
    </div>
@使用System.Diagnostics
运行此视图的标识为@Thread.CurrentPrincipal.identity
但是我得到一个错误,说名称线程不存在…

试试这个

@System.Threading.Thread.CurrentThread.ManagedThreadId