다음을 통해 공유


SPAudit.WriteAuditEvent Method (String, String, Int32, String)

Writes the audit entry with customized user ID.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Function WriteAuditEvent ( _
    eventName As String, _
    eventSource As String, _
    userId As Integer, _
    xmlData As String _
) As Boolean
'Usage
Dim instance As SPAudit
Dim eventName As String
Dim eventSource As String
Dim userId As Integer
Dim xmlData As String
Dim returnValue As Boolean

returnValue = instance.WriteAuditEvent(eventName, _
    eventSource, userId, xmlData)
public bool WriteAuditEvent(
    string eventName,
    string eventSource,
    int userId,
    string xmlData
)

Parameters

  • eventSource
    Type: System.String

    The name of the calling application.

Return Value

Type: System.Boolean
true if the event was recorded successfully; otherwise, false.

Remarks

Only the System Account will be able to specify the user ID. All other users trying to specify different IDs from their own will be regarded as spoofing and be terminated.

See Also

Reference

SPAudit Class

SPAudit Members

WriteAuditEvent Overload

Microsoft.SharePoint Namespace