(VB.NET) Extract Files from MIME
Extract files from a MIME message. Note: This example requires Chilkat v11.0.0 or greater.
Dim success As Boolean = False
' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim mime As New Chilkat.Mime
' Load a MIME document from a file:
' (.mht and .eml files contain MIME).
success = mime.LoadMimeFile("mst.mht")
If (success = False) Then
Debug.WriteLine(mime.LastErrorText)
Exit Sub
End If
Dim st As New Chilkat.StringTable
success = mime.PartsToFiles("/temp/mimeParts",st)
If (success = False) Then
Debug.WriteLine(mime.LastErrorText)
Exit Sub
End If
Dim n As Integer = st.Count
' Display the paths of the files created:
Dim i As Integer = 0
While i < n
Debug.WriteLine(st.StringAt(i))
i = i + 1
End While
|