共用方式為


DiscoveryClientDocumentCollection.Remove(String) 方法

定義

DiscoveryClientDocumentCollection 移除有指定 URL 的物件。

public:
 void Remove(System::String ^ url);
public void Remove (string url);
member this.Remove : string -> unit
Public Sub Remove (url As String)

參數

url
String

探索文件的 URL,此文件要從 DiscoveryClientDocumentCollection 中移除。

例外狀況

urlnull

範例

下列程式碼範例會從 移除具有 的 http://www.contoso.com/service1.disco URL 的 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 );

myDiscoveryClientDocumentCollection->Remove( myStringUrl1 );
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);
myDiscoveryClientDocumentCollection.Remove(myStringUrl1);
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)
myDiscoveryClientDocumentCollection.Remove(myStringUrl1)

適用於

另請參閱