按一下以給予評分及指教
MSDN
MSDN Library
.NET 開發
先前版本
類別庫參考
System
AppDomain 類別
AppDomain 方法
 GetCurrentThreadId 方法

  開啟低頻寬檢視
本頁僅適用於
Microsoft Visual Studio 2005/.NET Framework 2.0

其他版本也適用於下列軟體:
.NET Framework 類別庫
AppDomain.GetCurrentThreadId 方法

請注意:這個方法現在已經過時。

取得目前的執行緒識別項。

命名空間: System
組件: mscorlib (在 mscorlib.dll 中)

Visual Basic (宣告)
<ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.  http://go.microsoft.com/fwlink/?linkid=14202", False)> _
Public Shared Function GetCurrentThreadId As Integer
Visual Basic (使用方式)
Dim returnValue As Integer

returnValue = AppDomain.GetCurrentThreadId
C#
[ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.  http://go.microsoft.com/fwlink/?linkid=14202", false)] 
public static int GetCurrentThreadId ()
C++
[ObsoleteAttribute(L"AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.  http://go.microsoft.com/fwlink/?linkid=14202", false)] 
public:
static int GetCurrentThreadId ()
J#
/** @attribute ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.  http://go.microsoft.com/fwlink/?linkid=14202", false) */ 
public static int GetCurrentThreadId ()
JScript
ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread.  http://go.microsoft.com/fwlink/?linkid=14202", false) 
public static function GetCurrentThreadId () : int

傳回值

32 位元帶正負號的整數 (Signed Integer),其為目前執行緒的識別項。

Windows 98、 Windows 2000 SP4、 Windows Millennium Edition、 Windows Server 2003、 Windows XP Media Center Edition、 Windows XP Professional x64 Edition、 Windows XP SP2、 Windows XP Starter Edition

.NET Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。

.NET Framework

支援版本:1.0、1.1
在 2.0 中已過時 (編譯器警告)
社群內容   什麼是社群內容?
新增內容 RSS  註解
Processing
© 2009 Microsoft Corporation. 著作權所有,並保留一切權利。 使用規定  |  商標  |  隱私權聲明
Page view tracker