WebBaseEvent.ToString 方法

定义

为显示而对事件信息进行格式化。Formats event information for display purposes.

重载

ToString()

为显示而对事件信息进行格式化。Formats event information for display purposes.

ToString(Boolean, Boolean)

为显示而对事件信息进行格式化。Formats event information for display purposes.

ToString()

为显示而对事件信息进行格式化。Formats event information for display purposes.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

String

事件信息。The event information.

示例

下面的代码示例演示如何使用 ToString 方法The following code example shows how to use the ToString method

// Implements the ToString() method.
public override string ToString()
{
    return base.ToString();
}
' Implements the ToString() method.
Public Overrides Function ToString() As String
    Return MyBase.ToString()

End Function 'ToString

注解

ToString方法通常由处理事件的提供程序调用。The ToString method is generally invoked by the provider that processes the event. 方法可确保 WebApplicationInformation 向标准对象提供特定于事件的数据。The method ensures that the standard WebApplicationInformation object is provided with the event-specific data. 它通过调用特定于事件的方法来设置事件信息的格式 FormatCustomEventDetailsIt formats event information by calling the event-specific FormatCustomEventDetails method.

备注

在设置自定义事件信息的显示格式时,请重写 FormatCustomEventDetails 方法而不是 ToString 方法。When you format your custom event information for display, override the FormatCustomEventDetails method rather than the ToString method. 这将避免覆盖或篡改敏感系统信息。This will avoid overwriting or tampering with sensitive system information.

适用于

ToString(Boolean, Boolean)

为显示而对事件信息进行格式化。Formats event information for display purposes.

public:
 virtual System::String ^ ToString(bool includeAppInfo, bool includeCustomEventDetails);
public virtual string ToString (bool includeAppInfo, bool includeCustomEventDetails);
override this.ToString : bool * bool -> string
Public Overridable Function ToString (includeAppInfo As Boolean, includeCustomEventDetails As Boolean) As String

参数

includeAppInfo
Boolean

如果必须将标准的应用程序信息作为事件信息的一部分进行显示,则为 true;否则为 falsetrue if standard application information must be displayed as part of the event information; otherwise, false.

includeCustomEventDetails
Boolean

如果必须将自定义信息作为事件信息的一部分进行显示,则为 true;否则为 falsetrue if custom information must be displayed as part of the event information; otherwise, false.

返回

String

事件信息。The event information.

注解

ToString方法通常由处理事件的提供程序调用。The ToString method is generally invoked by the provider that processes the event. 它通过调用特定于事件的方法来设置事件信息的格式 FormatCustomEventDetailsIt formats event information by calling the event-specific FormatCustomEventDetails method. 如果 includeAppInfotrue ,则为标准 WebApplicationInformation 对象提供特定于事件的数据。If includeAppInfo is true, the standard WebApplicationInformation object is provided with the event-specific data.

备注

在设置自定义事件信息的显示格式时,请重写 FormatCustomEventDetails 方法而不是 ToString 方法。When you format your custom event information for display, override the FormatCustomEventDetails method rather than the ToString method. 这将避免覆盖或篡改敏感系统信息。This will avoid overwriting or tampering with sensitive system information.

适用于