2013-10-24 36 views
1

我想獲取服務器進程的標識。這是一個MVC 4/Razor項目。這是我有:如何顯示服務器進程的標識

@using System.Diagnostics 
    <div> 
     The identity running this view is @Thread.CurrentPrincipal.Identity 
    </div> 

但我得到一個錯誤說名字的主題不存在...

回答

0

試試這個,

@System.Threading.Thread.CurrentThread.ManagedThreadId 
+0

美麗!謝謝! – SantasNotReal

+0

you'r welcome .. – mecek

相關問題