共用方式為


一般通道屬性

下表說明一般通道屬性並列出支援這些屬性的通道型別。

屬性 說明 支援這個屬性的型別

name

字串,指定此通道的名稱。如果您沒有指定名稱,會按照下列型別使用預設名稱:

HttpChannel:"http"

HttpClientChannel:"http client"

HttpServerChannel:"http server"

TcpChannel:"tcp"

TcpClientChannel:"tcp client"

TcpServerChannel:"tcp server"

IpcChannel:"ipc"

IpcClientChannel:"ipc client"

IpcServerChannel:"ipc server"

每個通道必須具有唯一名稱。如果您想要呼叫名稱,但是想要避免命名衝突,請將此屬性設為空字串 ("" 或 String.Empty)。系統可允許使用任何數量的通道 (前提是 name 必須等於 String.Empty)。當呼叫 ChannelServices.GetChannel 方法時,會使用這個屬性來擷取特定通道。如需詳細資訊,請參閱通道

HttpChannel

HttpServerChannel

HttpClientChannel

TcpChannel

TcpClientChannel

TcpServerChannel

IpcChannel

IpcClientChannel

IpcServerChannel

machineName

指定與目前通道共用的電腦名稱的字串。如果搭配伺服器通道使用,則會覆寫 useIpAddress

Note注意:

一般而言,使用電腦的網域名稱系統 (DNS) 名稱是個好主意,但若是特定網路介面卡 (NIC) (通常是無線 NIC) 的 IP 位址會快速變更,您就必須將應用程式設定成使用 machineName,以啟用遠端處理透過 DNS 來找尋電腦。但是,當電腦名稱不是以合理的速度進行解析 (或完全不合理),且電腦有一個以上的 NIC 時,不論是實體或虛擬 (在撥號連線或 VPN 網路介面卡時通常是後者),您都應該將 machineName 屬性設定為目前供連線使用的 NIC 的 IP 位址。

HttpChannel

HttpClientChannel

HttpServerChannel

TcpChannel

TcpClientChannel

TcpServerChannel

priority

整數,表示指派給此通道的優先權。數值越高,表示被選上優先連接的機會越高。預設優先權是 1,並允許使用負數。

HttpChannel

HttpServerChannel

HttpClientChannel

TcpChannel

TcpClientChannel

TcpServerChannel

IpcChannel

IpcClientChannel

IpcServerChannel

secure (TcpChannel)

布林值 (truefalse),指定通道上的通訊是否安全。預設為 false。如果設為 true,則 tokenImpersonationLevel 屬性將設為 IdentificationprotectionLevel 屬性將設為 EncryptAndSign。請注意,安全的 TcpClientChannel 只能連接至安全的 TcpServerChannel,而不安全的 TcpClientChannel 也只能連接至不安全的 TcpServerChannel

Note注意:

如果伺服器電腦是執行 Windows 95、Windows 98,或 Windows Me,則 TcpServerChannel 就無法指定為安全。

TcpChannel

TcpClientChannel

TcpServerChannel

secure (IpcChannel)

布林值 (truefalse),指定通道上的通訊是否安全。預設為 false。當設定為 true 時,tokenImpersonationLevel 屬性會設定為 Identification。請注意,安全的 IpcClientChannel 可以連接至安全的或不安全的 IpcServerChannel,但是不安全的 IpcClientChannel 只能連接至不安全的 IpcServerChannel

IpcChannel

IpcClientChannel

IpcServerChannel

protectionLevel

型別 ProtectionLevel 的值。預設為 None,除非 secure 屬性設為 true,在此情況下預設為 EncryptAndSign。您必須將 secure 屬性設為 true,以便將 ProtectionLevel 屬性設為 None 以外的任何值。

請注意,None 是唯一與 Windows 95、Windows 98,或 Windows Me 相容的設定。

TcpClientChannel

TcpServerChannel

請參閱

工作

HOW TO:在組態檔中設定通道
HOW TO:以程式設計方式設定通道

參考

遠端設定結構描述

概念

遠端應用程式的組態
遠端物件組態
遠端物件組態

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.