MimePartCollection.Remove Method
Removes the first occurrence of the specified MimePart from the MimePartCollection.
[Visual Basic] Public Sub Remove( _ ByVal mimePart As MimePart _ ) [C#] public void Remove( MimePart mimePart ); [C++] public: void Remove( MimePart* mimePart ); [JScript] public function Remove( mimePart : MimePart );
Parameters
- mimePart
- The MimePart to remove from the collection.
Remarks
This method performs a linear search; therefore, the average execution time is proportional to Count.
The elements that follow the removed MimePart move up to occupy the vacated spot.
Example
[Visual Basic, C#, C++] The following example demonstrates a typical use of the Remove method.
[Visual Basic] Console.WriteLine("Removing a mimepart object...") ' Remove the mimepart from the mimepartcollection. myMimePartCollection.Remove(myMimePart1) ' Check whether the mimepart is removed or not. If Not myMimePartCollection.Contains(myMimePart1) Then Console.WriteLine("Mimepart is succesfully removed from mimepartcollection") End If [C#] Console.WriteLine("Removing a mimepart object..."); // Remove the mimepart from the mimepartcollection. myMimePartCollection.Remove(myMimePart1); // Check whether the mimepart is removed or not. if(!myMimePartCollection.Contains(myMimePart1)) { Console.WriteLine("Mimepart is succesfully removed from mimepartcollection"); } [C++] Console::WriteLine(S"Removing a mimepart object..."); // Remove the mimepart from the mimepartcollection. myMimePartCollection->Remove(myMimePart1); // Check whether the mimepart is removed or not. if (!myMimePartCollection->Contains(myMimePart1)) Console::WriteLine(S"Mimepart is succesfully removed from mimepartcollection");
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
MimePartCollection Class | MimePartCollection Members | System.Web.Services.Description Namespace