ContractReference.DefaultFilename 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得當儲存參考的服務描述時根據預設會使用的檔案名稱。
public:
virtual property System::String ^ DefaultFilename { System::String ^ get(); };
public override string DefaultFilename { get; }
member this.DefaultFilename : string
Public Overrides ReadOnly Property DefaultFilename As String
屬性值
預設檔案的名稱,將參考的服務描述儲存至檔案時使用。
範例
DiscoveryClientProtocol^ myProtocol = gcnew DiscoveryClientProtocol;
// Get the DiscoveryDocument.
DiscoveryDocument^ myDiscoveryDocument = myProtocol->Discover( "http://localhost/ContractReference/test_cs.disco" );
ArrayList^ myArrayList = dynamic_cast<ArrayList^>(myDiscoveryDocument->References);
// Get the ContractReference.
ContractReference^ myContractRefrence = dynamic_cast<ContractReference^>(myArrayList[ 0 ]);
// Get the DefaultFileName associated with the .disco file.
String^ myFileName = myContractRefrence->DefaultFilename;
// Get the URL associated with the .disco file.
String^ myUrl = myContractRefrence->Url;
Console::WriteLine( "The DefaulFilename is: {0}", myUrl );
Console::WriteLine( "The URL is: {0}", myUrl );
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();
// Get the DiscoveryDocument.
DiscoveryDocument myDiscoveryDocument =
myProtocol.Discover("http://localhost/ContractReference/test_cs.disco");
ArrayList myArrayList = (ArrayList)myDiscoveryDocument.References;
// Get the ContractReference.
ContractReference myContractRefrence = (ContractReference)myArrayList[0];
// Get the DefaultFileName associated with the .disco file.
String myFileName = myContractRefrence.DefaultFilename;
// Get the URL associated with the .disco file.
String myUrl = myContractRefrence.Url;
Console.WriteLine("The DefaulFilename is: " + myUrl);
Console.WriteLine("The URL is: " + myUrl);
Dim myProtocol As New DiscoveryClientProtocol()
' Get the DiscoveryDocument.
Dim myDiscoveryDocument As DiscoveryDocument = _
myProtocol.Discover("http://localhost/ContractReference/Test_vb.disco")
Dim myArrayList As ArrayList = _
CType(myDiscoveryDocument.References, ArrayList)
' Get the ContractReference.
Dim myContractRefrence As ContractReference = _
CType(myArrayList(0), ContractReference)
' Get the DefaultFileName associated with the .disco file.
Dim myFileName As String = myContractRefrence.DefaultFilename
' Get the URL associated with the .disco file.
Dim myUrl As String = myContractRefrence.Url
Console.WriteLine("The DefaulFilename is: " + myUrl)
Console.WriteLine("The URL is: " + myUrl)