共用方式為


SPMobileMessageContentPart Constructor (String, String, String, String)

Initializes a new instance of the SPMobileMessageContentPart class that has the specified MIME type, ID, location, and content.

Namespace:  Microsoft.SharePoint.MobileMessage
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub New ( _
    mimeType As String, _
    id As String, _
    location As String, _
    content As String _
)
'Usage
Dim mimeType As String
Dim id As String
Dim location As String
Dim content As String

Dim instance As New SPMobileMessageContentPart(mimeType, _
    id, location, content)
public SPMobileMessageContentPart(
    string mimeType,
    string id,
    string location,
    string content
)

Parameters

  • mimeType
    Type: System.String

    The MIME type of the content, such as “text/plain”.

  • id
    Type: System.String

    The ID of the content part. See Remarks for its structure.

  • location
    Type: System.String

    The filename of the content, not including the file extension. This parameter is not used in SharePoint Foundation, but it cannot be an empty string or a null reference (Nothing in Visual Basic). Pass any string.

Exceptions

Exception Condition
ArgumentException

One of the parameters is empty or a null reference (Nothing in Visual Basic).

Remarks

In SharePoint Foundation, mimeType must be “text/plain”.

id has the following structure:

Attserial_number[.file_extension]@ GUID_with_no_spaces_or_punctuation

The file extension is optional. serial_number is zero for the first content part in a given message. Each subsequent content part added gets a serial number that is one greater than its predecessor. The following is an example content part ID:

Att2.txt@f024b9c54a0742bc909f6bf5beff106c

See Also

Reference

SPMobileMessageContentPart Class

SPMobileMessageContentPart Members

SPMobileMessageContentPart Overload

Microsoft.SharePoint.MobileMessage Namespace