Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
MSG .NET
>
Tutorial
> Get attachments
The following example shows you how to get attachments and save them to file system.
C# example
using System; using Independentsoft.Msg; namespace Sample { class Program { static void Main(string[] args) { Message message = new Message("c:\\temp\\test.msg"); foreach (Attachment attachment in message.Attachments) { attachment.Save("c:\\temp\\" + attachment.DisplayName); } } } }
VB example
Imports System Imports Independentsoft.Msg Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim message As New Message("c:\temp\test.msg") For Each attachment As Attachment In message.Attachments attachment.Save("c:\temp\" & attachment.DisplayName) Next End Sub End Class End Namespace