共用方式為


SPAuditEntry.ToString Method

Gets the values of all of the SPAuditEntry properties as XML markup.

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

Syntax

'Declaration
Public Overrides Function ToString As String
'Usage
Dim instance As SPAuditEntry
Dim returnValue As String

returnValue = instance.ToString()
public override string ToString()

Return Value

Type: System.String
A String that represents all the data for the audit entry in XML.

Remarks

The following is an example of the value returned by ToString. The indentation and line breaks have been added for clarity. An actual returned value has no white space or line breaks. The following elements are present in any returned value: <AuditEntry>, <SiteId>, <ItemType>, <Occurred>, <Event>, and <EventSource>.

The other elements are not present in certain circumstances as follows.

  • <UserId> is not present if its value is less than 0. (The UserID of the system account is -1.)

  • <LocationType> is not present if its value is Invalid.

  • Any other element that is not always present (see above) is suppressed if it is a null reference (Nothing in Visual Basic).

<AuditEntry> 
    <SiteId>4709294F-CCCC-4BA5-B6BF-329BF39FA1E4</SiteId> 
    <ItemId>936DA01F-9ABD-4d9d-80C7-02AF85C822A8</ItemId> 
    <ItemType>Document</ItemType> 
    <UserId>22</UserId>
    <MachineName>SallyPC</MachineName>
    <MachineIP>253.253.253.253</MachineIP>
    <DocLocation>My Invoice Library</DocLocation>
    <LocationType>Url</LocationType>
    <Occurred>4/17/2006 2:22:48 PM</Occurred> 
    <Event>Custom</Event>
    <EventName>InvoiceApproved</EventName>
    <EventSource>SharePoint</EventSource>
    <SourceName>My SharePoint Solution</SourceName>
    <EventData>
         <!-- See the EventData property for details about the kind -->
         <!-- of markup that can be here. -->
     </EventData>
<AuditEntry>

See Also

Reference

SPAuditEntry Class

SPAuditEntry Members

Microsoft.SharePoint Namespace