ServiceBehaviorAttribute ServiceBehaviorAttribute ServiceBehaviorAttribute ServiceBehaviorAttribute Class

定义

指定服务协定实现的内部执行行为。Specifies the internal execution behavior of a service contract implementation.

public ref class ServiceBehaviorAttribute sealed : Attribute, System::ServiceModel::Description::IServiceBehavior
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class ServiceBehaviorAttribute : Attribute, System.ServiceModel.Description.IServiceBehavior
type ServiceBehaviorAttribute = class
    inherit Attribute
    interface IServiceBehavior
Public NotInheritable Class ServiceBehaviorAttribute
Inherits Attribute
Implements IServiceBehavior
继承
ServiceBehaviorAttributeServiceBehaviorAttributeServiceBehaviorAttributeServiceBehaviorAttribute
属性
实现

示例

下面的代码示例演示了 ServiceBehaviorAttribute 属性。The following code example demonstrates the ServiceBehaviorAttribute properties. BehaviorService 类使用 ServiceBehaviorAttribute 属性以指示:The BehaviorService class uses the ServiceBehaviorAttribute attribute to indicate that:

  • 事务完成后,回收服务对象。The service object is recycled when the transaction completes.

  • 每个会话都有一个服务对象。There is one service object for each session.

  • 服务是单线程服务,不支持可重入调用。The service is single-threaded and does not support reentrant calls.

而且,在操作级别,OperationBehaviorAttribute 值指示 TxWork 方法将自动登记到流事务中或创建新事务来做这项工作,并指示如果没有发生未经处理的异常,则自动提交此事务。Furthermore, at the operation level, the OperationBehaviorAttribute values indicate that the TxWork method automatically enlists in flowed transactions or creates a new transaction to do the work, and that the transaction is committed automatically if an unhandled exception does not occur.

using System;
using System.ServiceModel;
using System.Transactions;

namespace Microsoft.WCF.Documentation
{
  [ServiceContract(
    Namespace="http://microsoft.wcf.documentation", 
    SessionMode=SessionMode.Required
  )]
  public interface IBehaviorService
  {
    [OperationContract]
    string TxWork(string message);
  }

  // Note: To use the TransactionIsolationLevel property, you 
  // must add a reference to the System.Transactions.dll assembly.
  /* The following service implementation:
   *   -- Processes messages on one thread at a time
   *   -- Creates one service object per session
   *   -- Releases the service object when the transaction commits
   */
  [ServiceBehavior(
    ConcurrencyMode=ConcurrencyMode.Single,
    InstanceContextMode=InstanceContextMode.PerSession,
    ReleaseServiceInstanceOnTransactionComplete=true
  )]
  public class BehaviorService : IBehaviorService, IDisposable
  {
    Guid myID;

    public BehaviorService()
    {
      myID = Guid.NewGuid();
      Console.WriteLine(
        "Object "
        + myID.ToString()
        + " created.");
    }

    /*
     * The following operation-level behaviors are specified:
     *   -- The executing transaction is committed when
     *        the operation completes without an 
     *        unhandled exception
     *   -- Always executes under a flowed transaction.
     */
    [OperationBehavior(
      TransactionAutoComplete = true,
      TransactionScopeRequired = true
    )]
    [TransactionFlow(TransactionFlowOption.Mandatory)]
    public string TxWork(string message)
    {
      // Do some transactable work.
      Console.WriteLine("TxWork called with: " + message);
      // Display transaction information.

      TransactionInformation info = Transaction.Current.TransactionInformation;
      Console.WriteLine("The distributed tx ID: {0}.", info.DistributedIdentifier);
      Console.WriteLine("The tx status: {0}.", info.Status);
      return String.Format("Hello. This was object {0}.",myID.ToString()) ;
    }

    public void Dispose()
    {
      Console.WriteLine(
        "Service "
        + myID.ToString()
        + " is being recycled."
      );
    }
  }
}
Imports System.ServiceModel
Imports System.Transactions

Namespace Microsoft.WCF.Documentation
  <ServiceContract(Namespace:="http://microsoft.wcf.documentation", SessionMode:=SessionMode.Required)> _
  Public Interface IBehaviorService
	<OperationContract> _
	Function TxWork(ByVal message As String) As String
  End Interface

  ' Note: To use the TransactionIsolationLevel property, you 
  ' must add a reference to the System.Transactions.dll assembly.
'   The following service implementation:
'   *   -- Processes messages on one thread at a time
'   *   -- Creates one service object per session
'   *   -- Releases the service object when the transaction commits
'   
    <ServiceBehavior(ConcurrencyMode:=ConcurrencyMode.Single, InstanceContextMode:=InstanceContextMode.PerSession, _
                     ReleaseServiceInstanceOnTransactionComplete:=True)> _
    Public Class BehaviorService
        Implements IBehaviorService, IDisposable
        Private myID As Guid

        Public Sub New()
            myID = Guid.NewGuid()
            Console.WriteLine("Object " & myID.ToString() & " created.")
        End Sub

        '    
        '     * The following operation-level behaviors are specified:
        '     *   -- The executing transaction is committed when
        '     *        the operation completes without an 
        '     *        unhandled exception
        '     *   -- Always executes under a flowed transaction.
        '     
        <OperationBehavior(TransactionAutoComplete:=True, TransactionScopeRequired:=True), TransactionFlow(TransactionFlowOption.Mandatory)> _
        Public Function TxWork(ByVal message As String) As String Implements IBehaviorService.TxWork
            ' Do some transactable work.
            Console.WriteLine("TxWork called with: " & message)
            ' Display transaction information.

            Dim info As TransactionInformation = Transaction.Current.TransactionInformation
            Console.WriteLine("The distributed tx ID: {0}.", info.DistributedIdentifier)
            Console.WriteLine("The tx status: {0}.", info.Status)
            Return String.Format("Hello. This was object {0}.", myID.ToString())
        End Function

        Public Sub Dispose() Implements IDisposable.Dispose
            Console.WriteLine("Service " & myID.ToString() & " is being recycled.")
        End Sub
    End Class
End Namespace

为了正确执行下面的代码示例,基础绑定必须支持流事务。The underlying binding must support flowed transactions for the following code example to execute properly. 例如,若要使用 WSHttpBinding 支持流事务,请在代码或应用程序配置文件中将 TransactionFlow 属性设置为 trueTo support flowed transactions using the WSHttpBinding, for example, set the TransactionFlow property to true in code or in an application configuration file. 下面的代码示例演示上述示例的配置文件。The following code example shows the configuration file for the preceding sample.

<configuration>
  <system.serviceModel>
    <services>
      <service  
        name="Microsoft.WCF.Documentation.BehaviorService" 
        behaviorConfiguration="metadataAndDebugEnabled"
      >
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/SampleService"/>
          </baseAddresses>
        </host>
        <!--
          Note:
            This example code uses the WSHttpBinding to support transactions using the 
            WS-AtomicTransactions (WS-AT) protocol. WSHttpBinding is configured to use the  
            protocol, but the protocol is not enabled on some computers. Use the xws_reg -wsat+ 
            command to enable the WS-AtomicTransactions protocol in the MSDTC service.          
          -->
        <endpoint 
           contract="Microsoft.WCF.Documentation.IBehaviorService"
           binding="wsHttpBinding"
           bindingConfiguration="wsHttpBindingWithTXFlow"
           address="http://localhost:8080/BehaviorService"
          />
        <endpoint 
           contract="Microsoft.WCF.Documentation.IBehaviorService"
           binding="netTcpBinding"
           bindingConfiguration="netTcpBindingWithTXFlow"
           address="net.tcp://localhost:8081/BehaviorService"
          />
        <endpoint
          address="mex"
          binding="mexHttpBinding"
          contract="IMetadataExchange"
        />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="metadataAndDebugEnabled">
          <serviceDebug
            includeExceptionDetailInFaults="true"
          />
          <serviceMetadata
            httpGetEnabled="true"
            httpGetUrl=""
          />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <!-- binding configuration - configures a WSHttpBinding to require transaction flow -->
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingWithTXFlow" transactionFlow="true" />
      </wsHttpBinding>
      <netTcpBinding>
        <binding name="netTcpBindingWithTXFlow" transactionFlow="true" />
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

注解

ServiceBehaviorAttribute 属性应用于服务实现,以指定服务范围的执行行为。Apply the ServiceBehaviorAttribute attribute to a service implementation to specify service-wide execution behavior. (若是在方法级别指定执行行为,请使用 OperationBehaviorAttribute 属性。)此属性仅可应用于服务实现。(To specify execution behavior at the method level, use the OperationBehaviorAttribute attribute.) This attribute can be applied only to service implementations. 有关工作示例,请参阅服务:行为示例For working examples, see the Service: Behaviors Samples.

ServiceBehaviorAttribute 属性是 Windows Communication Foundation (WCF) 编程模型功能,使开发人员必须实现的常见功能。ServiceBehaviorAttribute properties are a Windows Communication Foundation (WCF) programming model feature that enables common features that developers otherwise have to implement. 有关这些和其他行为的详细信息,请参阅指定服务运行时行为For more information about these and other behaviors, see Specifying Service Run-Time Behavior. 有关基础运行时属性的详细信息部分的以下属性集,请参阅扩展 ServiceHost 和服务模型层For more information about the underlying runtime properties that some of the following properties set, see Extending ServiceHost and the Service Model Layer.

  • AddressFilterMode 属性指定筛选器的类型,调度程序系统使用该类型的筛选器来查找处理请求的终结点。The AddressFilterMode property specifies the type of filter that the dispatcher system uses to locate the endpoint that handles requests.

  • AutomaticSessionShutdown 属性会在通道关闭且服务已处理完所有剩余消息时自动关闭会话。The AutomaticSessionShutdown property automatically closes the session when the channel is closed and the service has finished processing any remaining messages.

  • ConcurrencyMode 属性可控制内部线程模型,使系统可以支持可重入或多线程服务。The ConcurrencyMode property controls the internal threading model, enabling support for reentrant or multithreaded services.

  • ConfigurationName 属性用来声明一个名称,以便在配置文件中 name 元素的 <service> 属性中使用。The ConfigurationName property is used to declare a name for use in the name attribute of the <service> element in a configuration file.

  • IgnoreExtensionDataObject 属性使系统可以在运行时忽略处理消息时不需要的额外序列化信息。The IgnoreExtensionDataObject property enables the run time to ignore extra serialization information that is not required to process the message.

  • IncludeExceptionDetailInFaults 属性指定服务中未经处理的异常是否要作为 SOAP 错误返回。The IncludeExceptionDetailInFaults property specifies whether unhandled exceptions in a service are returned as SOAP faults. 此属性仅用于调试目的。This is for debugging purposes only.

  • InstanceContextMode 属性指定在与客户端交换期间是否回收,以及何时回收服务及其服务对象。The InstanceContextMode property specifies whether and when services and their service objects are to be recycled during an exchange with a client.

  • MaxItemsInObjectGraph 属性限制对象图中要序列化的项数。The MaxItemsInObjectGraph property to limit on the number of items in an object graph that are serialized.

  • NameNamespace 属性控制服务元素的 WSDL 表达式的名称和命名空间。The Name and Namespace properties control the name and namespace for the WSDL expression of the service element.

  • ReleaseServiceInstanceOnTransactionComplete 属性指定当事务完成后是否回收服务对象。The ReleaseServiceInstanceOnTransactionComplete property specifies whether the service object is recycled when a transaction completes.

  • TransactionAutoCompleteOnSessionClose 属性指定会话关闭时是否完成未处理的事务。The TransactionAutoCompleteOnSessionClose property specifies whether outstanding transactions are completed when the session closes.

  • TransactionIsolationLevel 属性指定协定支持的事务隔离级别。The TransactionIsolationLevel property specifies the transaction isolation level that the contract supports.

  • TransactionTimeout 属性指定必须完成事务的时间段,超过该时间段,事务将中止。The TransactionTimeout property specifies the time period within which a transaction must complete or it aborts.

  • UseSynchronizationContext 属性指示是否自动同步入站方法调用与用户界面线程。The UseSynchronizationContext property indicates whether to synchronize inbound method calls with the user interface thread automatically.

  • ValidateMustUnderstand 属性通知系统它是否应确认标记为 MustUnderstand 的 SOAP 标头是否确实已被理解。The ValidateMustUnderstand property informs the system whether it should confirm that SOAP headers marked as MustUnderstand have, in fact, been understood.

IncludeExceptionDetailInFaults 属性也可以使用应用程序配置文件进行设置。The IncludeExceptionDetailInFaults property can also be set using an application configuration file. 有关详细信息,请参阅 IncludeExceptionDetailInFaultsFor details, see IncludeExceptionDetailInFaults.

构造函数

ServiceBehaviorAttribute() ServiceBehaviorAttribute() ServiceBehaviorAttribute() ServiceBehaviorAttribute()

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

属性

AddressFilterMode AddressFilterMode AddressFilterMode AddressFilterMode

获取或设置调度程序用于将传入消息路由到正确终结点的 AddressFilterModeGets or sets the AddressFilterMode that is used by the dispatcher to route incoming messages to the correct endpoint.

AutomaticSessionShutdown AutomaticSessionShutdown AutomaticSessionShutdown AutomaticSessionShutdown

指定在客户端关闭输出会话时是否自动关闭会话。Specifies whether to automatically close a session when a client closes an output session.

ConcurrencyMode ConcurrencyMode ConcurrencyMode ConcurrencyMode

获取或设置一个值,该值指示服务是支持单线程、多线程还是支持可重入调用。Gets or sets whether a service supports one thread, multiple threads, or reentrant calls.

ConfigurationName ConfigurationName ConfigurationName ConfigurationName

获取或设置用于在应用程序配置文件中定位服务元素的值。Gets or sets the value used to locate the service element in an application configuration file.

EnsureOrderedDispatch EnsureOrderedDispatch EnsureOrderedDispatch EnsureOrderedDispatch

获取或设置指示是否确保服务有序调度的值。Gets or sets a value that indicates whether the service ordered dispatch is ensured.

IgnoreExtensionDataObject IgnoreExtensionDataObject IgnoreExtensionDataObject IgnoreExtensionDataObject

获取或设置一个值,该值指定是否将未知序列化数据发送到网络上。Gets or sets a value that specifies whether to send unknown serialization data onto the wire.

IncludeExceptionDetailInFaults IncludeExceptionDetailInFaults IncludeExceptionDetailInFaults IncludeExceptionDetailInFaults

获取或设置一个值,该值指定是否要将常规未处理执行异常转换为 FaultException<TDetail> 类型的 ExceptionDetail 并将其作为错误消息发送。Gets or sets a value that specifies that general unhandled execution exceptions are to be converted into a FaultException<TDetail> of type ExceptionDetail and sent as a fault message. 仅在开发阶段将其设置为 true 以便对服务进行故障排除。Set this to true only during development to troubleshoot a service.

InstanceContextMode InstanceContextMode InstanceContextMode InstanceContextMode

获取或设置指示新服务对象何时创建的值。Gets or sets the value that indicates when new service objects are created.

MaxItemsInObjectGraph MaxItemsInObjectGraph MaxItemsInObjectGraph MaxItemsInObjectGraph

获取或设置序列化对象中允许的最大项数。Gets or sets the maximum number of items allowed in a serialized object.

Name Name Name Name

获取或设置 Web 服务描述语言 (WSDL) 中服务元素中的名称属性值。Gets or sets the value of the name attribute in the service element in Web Services Description Language (WSDL).

Namespace Namespace Namespace Namespace

获取或设置 Web 服务描述语言 (WSDL) 中服务的目标命名空间值。Gets or sets the value of the target namespace for the service in Web Services Description Language (WSDL).

ReleaseServiceInstanceOnTransactionComplete ReleaseServiceInstanceOnTransactionComplete ReleaseServiceInstanceOnTransactionComplete ReleaseServiceInstanceOnTransactionComplete

获取或设置一个值,该值指定在完成当前事务后是否释放服务对象。Gets or sets a value that specifies whether the service object is released when the current transaction completes.

TransactionAutoCompleteOnSessionClose TransactionAutoCompleteOnSessionClose TransactionAutoCompleteOnSessionClose TransactionAutoCompleteOnSessionClose

获取或设置一个值,该值指定当前会话正常关闭时是否完成挂起事务。Gets or sets a value that specifies whether pending transactions are completed when the current session closes without error.

TransactionIsolationLevel TransactionIsolationLevel TransactionIsolationLevel TransactionIsolationLevel

指定服务中新创建的事务和客户端传入的流事务的事务隔离级别。Specifies the transaction isolation level for new transactions created inside the service, and incoming transactions flowed from a client.

TransactionTimeout TransactionTimeout TransactionTimeout TransactionTimeout

获取或设置事务必须在此期间完成的时间段。Gets or sets the period within which a transaction must complete.

TypeId TypeId TypeId TypeId

在派生类中实现时,获取此 Attribute 的唯一标识符。When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)
UseSynchronizationContext UseSynchronizationContext UseSynchronizationContext UseSynchronizationContext

获取或设置一个值,该值指定是否使用当前同步上下文来选择执行的线程。Gets or sets a value that specifies whether to use the current synchronization context to choose the thread of execution.

ValidateMustUnderstand ValidateMustUnderstand ValidateMustUnderstand ValidateMustUnderstand

获取或设置一个值,该值指定是由系统还是由应用程序强制执行 SOAP MustUnderstand 标头处理。Gets or sets a value that specifies whether the system or the application enforces SOAP MustUnderstand header processing.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

(Inherited from Attribute)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetWellKnownSingleton() GetWellKnownSingleton() GetWellKnownSingleton() GetWellKnownSingleton()

检索实现此服务的对象,该对象被用作服务的单一实例;如果没有单一实例,则为 nullRetrieves an object that implements the service and that is used as the singleton instance of the service, or null if there is no singleton instance.

IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute()

在派生类中重写时,指示此实例的值是否是派生类的默认值。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object) Match(Object) Match(Object) Match(Object)

当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
SetWellKnownSingleton(Object) SetWellKnownSingleton(Object) SetWellKnownSingleton(Object) SetWellKnownSingleton(Object)

指定实现此服务的对象,该对象被用作服务的单一实例。Specifies an object that implements the service and that is used as the singleton instance of the service.

ShouldSerializeConfigurationName() ShouldSerializeConfigurationName() ShouldSerializeConfigurationName() ShouldSerializeConfigurationName()

返回一个值,该值指示 ConfigurationName 属性是否已更改,不再是默认值且应对其进行序列化。Returns a value that indicates whether the ConfigurationName property has changed from its default value and should be serialized.

ShouldSerializeReleaseServiceInstanceOnTransactionComplete() ShouldSerializeReleaseServiceInstanceOnTransactionComplete() ShouldSerializeReleaseServiceInstanceOnTransactionComplete() ShouldSerializeReleaseServiceInstanceOnTransactionComplete()

返回一个值,该值指示 ReleaseServiceInstanceOnTransactionComplete 属性是否已更改,不再是默认值且应对其进行序列化。Returns a value that indicates whether the ReleaseServiceInstanceOnTransactionComplete property has changed from its default value and should be serialized.

ShouldSerializeTransactionAutoCompleteOnSessionClose() ShouldSerializeTransactionAutoCompleteOnSessionClose() ShouldSerializeTransactionAutoCompleteOnSessionClose() ShouldSerializeTransactionAutoCompleteOnSessionClose()

返回一个值,该值指示 TransactionAutoCompleteOnSessionClose 属性是否已更改,不再是默认值且应对其进行序列化。Returns a value that indicates whether the TransactionAutoCompleteOnSessionClose property has changed from its default value and should be serialized.

ShouldSerializeTransactionIsolationLevel() ShouldSerializeTransactionIsolationLevel() ShouldSerializeTransactionIsolationLevel() ShouldSerializeTransactionIsolationLevel()

返回一个值,该值指示 TransactionIsolationLevel 属性是否已更改,不再是默认值且应对其进行序列化。Returns a value that indicates whether the TransactionIsolationLevel property has changed from its default value and should be serialized.

ShouldSerializeTransactionTimeout() ShouldSerializeTransactionTimeout() ShouldSerializeTransactionTimeout() ShouldSerializeTransactionTimeout()

返回一个值,该值指示 TransactionTimeout 属性是否已更改,不再是默认值且应对其进行序列化。Returns a value that indicates whether the TransactionTimeout property has changed from its default value and should be serialized.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

IServiceBehavior.AddBindingParameters(ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection) IServiceBehavior.AddBindingParameters(ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection) IServiceBehavior.AddBindingParameters(ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection) IServiceBehavior.AddBindingParameters(ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection)

将自定义数据对象传递到支持此行为属性的绑定。Passes custom data objects to the bindings that support the behavior properties.

IServiceBehavior.ApplyDispatchBehavior(ServiceDescription, ServiceHostBase) IServiceBehavior.ApplyDispatchBehavior(ServiceDescription, ServiceHostBase) IServiceBehavior.ApplyDispatchBehavior(ServiceDescription, ServiceHostBase) IServiceBehavior.ApplyDispatchBehavior(ServiceDescription, ServiceHostBase)

自定义服务运行时,以支持行为属性。Customizes the service run time to support the behavior properties.

IServiceBehavior.Validate(ServiceDescription, ServiceHostBase) IServiceBehavior.Validate(ServiceDescription, ServiceHostBase) IServiceBehavior.Validate(ServiceDescription, ServiceHostBase) IServiceBehavior.Validate(ServiceDescription, ServiceHostBase)

确认服务说明和服务主机是否支持此行为。Confirms that the service description and service host are capable of supporting the behavior.

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

适用于

另请参阅