DiscoveryClientDocumentCollection.Add(String, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將有指定 URL 的物件加入至 DiscoveryClientDocumentCollection。
public:
void Add(System::String ^ url, System::Object ^ value);
public void Add (string url, object value);
member this.Add : string * obj -> unit
Public Sub Add (url As String, value As Object)
參數
- url
- String
要加入至 DiscoveryClientDocumentCollection 的文件之 URL。
- value
- Object
要加入至 DiscoveryClientDocumentCollection 的探索文件。
例外狀況
url
為 null
。
具有 url
的索引鍵的項目已經存在於 DiscoveryClientDocumentCollection 中。
範例
下列程式碼範例會將兩個 DiscoveryClientDocumentCollection 探索檔新增至 。
DiscoveryClientDocumentCollection^ myDiscoveryClientDocumentCollection = gcnew DiscoveryClientDocumentCollection;
DiscoveryDocument^ myDiscoveryDocument = gcnew DiscoveryDocument;
String^ myStringUrl = "http://www.contoso.com/service.disco";
String^ myStringUrl1 = "http://www.contoso.com/service1.disco";
myDiscoveryClientDocumentCollection->Add( myStringUrl, myDiscoveryDocument );
myDiscoveryClientDocumentCollection->Add( myStringUrl1, myDiscoveryDocument );
DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
new DiscoveryClientDocumentCollection();
DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();
string myStringUrl = "http://www.contoso.com/service.disco";
string myStringUrl1 = "http://www.contoso.com/service1.disco";
myDiscoveryClientDocumentCollection.Add(myStringUrl, myDiscoveryDocument);
myDiscoveryClientDocumentCollection.Add(myStringUrl1, myDiscoveryDocument);
Dim myDiscoveryClientDocumentCollection As New DiscoveryClientDocumentCollection()
Dim myDiscoveryDocument As New DiscoveryDocument()
Dim myStringUrl As String = "http://www.contoso.com/service.disco"
Dim myStringUrl1 As String = "http://www.contoso.com/service1.disco"
myDiscoveryClientDocumentCollection.Add(myStringUrl, myDiscoveryDocument)
myDiscoveryClientDocumentCollection.Add(myStringUrl1, myDiscoveryDocument)