DiscoveryClientResult 构造函数

定义

初始化 DiscoveryClientResult 类的新实例。Initializes a new instance of the DiscoveryClientResult class.

重载

DiscoveryClientResult()

初始化 DiscoveryClientResult 类的新实例。Initializes a new instance of the DiscoveryClientResult class.

DiscoveryClientResult(Type, String, String)

初始化 DiscoveryClientResult 类的新实例并将 ReferenceTypeName 属性设置为 referenceType,将 Url 属性设置为 url,并将 Filename 属性设置为 filenameInitializes a new instance of the DiscoveryClientResult class and sets the ReferenceTypeName property to referenceType, the Url property to url and the Filename property to filename.

DiscoveryClientResult()

初始化 DiscoveryClientResult 类的新实例。Initializes a new instance of the DiscoveryClientResult class.

public:
 DiscoveryClientResult();
public DiscoveryClientResult ();
Public Sub New ()

示例

// Initialize new instance of the DiscoveryClientResult class.
DiscoveryClientResult^ myDiscoveryClientResult = gcnew DiscoveryClientResult;

// Set the type of reference in the discovery document as 
// DiscoveryDocumentReference.
myDiscoveryClientResult->ReferenceTypeName = "System.Web.Services.Discovery.DiscoveryDocumentReference";

// Set the URL for the reference.
myDiscoveryClientResult->Url = "http://localhost/Discovery/Service1_cs.asmx?disco";

// Set the name of the file in which the reference is saved.
myDiscoveryClientResult->Filename = "Service1_cs.disco";

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection->Add( myDiscoveryClientResult );
// Initialize new instance of the DiscoveryClientResult class.
DiscoveryClientResult myDiscoveryClientResult =
    new DiscoveryClientResult();

// Set the type of reference in the discovery document as
// DiscoveryDocumentReference.
myDiscoveryClientResult.ReferenceTypeName =
    "System.Web.Services.Discovery.DiscoveryDocumentReference";

// Set the URL for the reference.
myDiscoveryClientResult.Url =
    "http://localhost/Discovery/Service1_cs.asmx?disco";

// Set the name of the file in which the reference is saved.
myDiscoveryClientResult.Filename = "Service1_cs.disco";

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
' Initialize a new instance of the DiscoveryClientResult class.
Dim myDiscoveryClientResult As New DiscoveryClientResult()

' Set the type of reference in the discovery document as 
' DiscoveryDocumentReference.
myDiscoveryClientResult.ReferenceTypeName = _
    "System.Web.Services.Discovery.DiscoveryDocumentReference"

' Set the URL for the reference.
myDiscoveryClientResult.Url = _
    "http://localhost/Discovery/Service1_vb.asmx?disco"

' Set the name of the file in which the reference is saved.
myDiscoveryClientResult.Filename = "Service1_vb.disco"

' Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult)

适用于

DiscoveryClientResult(Type, String, String)

初始化 DiscoveryClientResult 类的新实例并将 ReferenceTypeName 属性设置为 referenceType,将 Url 属性设置为 url,并将 Filename 属性设置为 filenameInitializes a new instance of the DiscoveryClientResult class and sets the ReferenceTypeName property to referenceType, the Url property to url and the Filename property to filename.

public:
 DiscoveryClientResult(Type ^ referenceType, System::String ^ url, System::String ^ filename);
public DiscoveryClientResult (Type referenceType, string url, string filename);
new System.Web.Services.Discovery.DiscoveryClientResult : Type * string * string -> System.Web.Services.Discovery.DiscoveryClientResult
Public Sub New (referenceType As Type, url As String, filename As String)

参数

referenceType
Type

表示发现文档中引用类型的类的名称。Name of the class representing the type of reference in the discovery document. 设置 ReferenceTypeName 属性。Sets the ReferenceTypeName property.

url
String

引用的 URL。URL for the reference. 设置 Url 属性。Sets the Url property.

filename
String

将引用保存到其中的文件的名称。Name of the file in which the reference was saved. 设置 Filename 属性。Sets the Filename property.

示例

// Initialize a new instance of the DiscoveryClientResult class.
DiscoveryClientResult^ myDiscoveryClientResult =
   gcnew DiscoveryClientResult( System::Web::Services::Discovery::DiscoveryDocumentReference::typeid,
   "http://localhost/Discovery/Service1_cs.asmx?disco","Service1_cs.disco" );

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection->Add( myDiscoveryClientResult );
// Initialize a new instance of the DiscoveryClientResult class.
DiscoveryClientResult myDiscoveryClientResult =
   new DiscoveryClientResult(
   typeof(System.Web.Services.Discovery.DiscoveryDocumentReference),
   "http://localhost/Discovery/Service1_cs.asmx?disco",
   "Service1_cs.disco");

// Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
' Initialize a new instance of the DiscoveryClientResult class.
Dim myDiscoveryClientResult As New DiscoveryClientResult( _
   GetType(System.Web.Services.Discovery.DiscoveryDocumentReference), _
   "http://localhost/Discovery/Service1_vb.asmx?disco", _
   "Service1_vb.disco")

' Add the DiscoveryClientResult to the collection.
myDiscoveryClientResultCollection.Add(myDiscoveryClientResult)

适用于