共用方式為


InteractiveSession.IsRemote 屬性

定義

指出呼叫進程是否正在遠端桌面會話中執行。

public:
 static property bool IsRemote { bool get(); };
static bool IsRemote();
public static bool IsRemote { get; }
var boolean = InteractiveSession.isRemote;
Public Shared ReadOnly Property IsRemote As Boolean

屬性值

Boolean

bool

如果目前的進程正在遠端會話中執行,則包含 True ,否則為 False

範例

OutputTextBlock1.Text = String.Format("The current session is : {0}", 
    (InteractiveSession.IsRemote ? "Remote" : "Local"));
OutputTextBlock1->Text = "The current session is : " + 
    (Windows::System::RemoteDesktop::InteractiveSession::IsRemote ? "Remote" : "Local");
OutputTextBlock1.Text = String.Format("The current session is : {0}",
    (If(InteractiveSession.IsRemote, "Remote", "Local")))

適用於