Messaging: Prepare new email lib
This commit is contained in:
@@ -32,7 +32,7 @@ Namespace My
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Protected Overrides Sub OnCreateMainForm()
|
||||
Me.MainForm = Global.TestGUI.frmDocView
|
||||
Me.MainForm = Global.TestGUI.frmStart
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>frmDocView</MainForm>
|
||||
<MainForm>frmStart</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mail">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Limilabs\Mail.dll\Mail.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
@@ -175,6 +178,12 @@
|
||||
<Compile Include="frmLookup.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMail.Designer.vb">
|
||||
<DependentUpon>frmMail.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMail.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmOld.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -233,6 +242,9 @@
|
||||
<EmbeddedResource Include="frmLookup.resx">
|
||||
<DependentUpon>frmLookup.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMail.resx">
|
||||
<DependentUpon>frmMail.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmOld.resx">
|
||||
<DependentUpon>frmOld.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
69
GUIs.Test.TestGUI/frmMail.Designer.vb
generated
Normal file
69
GUIs.Test.TestGUI/frmMail.Designer.vb
generated
Normal file
@@ -0,0 +1,69 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmMail
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.ListBox1 = New System.Windows.Forms.ListBox()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Button1
|
||||
'
|
||||
Me.Button1.Location = New System.Drawing.Point(12, 12)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(352, 65)
|
||||
Me.Button1.TabIndex = 0
|
||||
Me.Button1.Text = "Load Email"
|
||||
Me.Button1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'OpenFileDialog1
|
||||
'
|
||||
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
|
||||
'
|
||||
'ListBox1
|
||||
'
|
||||
Me.ListBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.ListBox1.FormattingEnabled = True
|
||||
Me.ListBox1.Location = New System.Drawing.Point(12, 83)
|
||||
Me.ListBox1.Name = "ListBox1"
|
||||
Me.ListBox1.Size = New System.Drawing.Size(352, 355)
|
||||
Me.ListBox1.TabIndex = 1
|
||||
'
|
||||
'frmMail
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(381, 450)
|
||||
Me.Controls.Add(Me.ListBox1)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Name = "frmMail"
|
||||
Me.Text = "frmMail"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Button1 As Button
|
||||
Friend WithEvents OpenFileDialog1 As OpenFileDialog
|
||||
Friend WithEvents ListBox1 As ListBox
|
||||
End Class
|
||||
123
GUIs.Test.TestGUI/frmMail.resx
Normal file
123
GUIs.Test.TestGUI/frmMail.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
34
GUIs.Test.TestGUI/frmMail.vb
Normal file
34
GUIs.Test.TestGUI/frmMail.vb
Normal file
@@ -0,0 +1,34 @@
|
||||
Imports Limilabs.Mail
|
||||
Imports Limilabs.Mail.MSG
|
||||
|
||||
Public Class frmMail
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Dim oResult = OpenFileDialog1.ShowDialog()
|
||||
|
||||
If oResult = DialogResult.OK Then
|
||||
Dim oMail As String = OpenFileDialog1.FileName
|
||||
|
||||
ParseEmail(oMail)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ParseEmail(Path As String)
|
||||
Using oConverter As New MsgConverter(Path)
|
||||
If oConverter.Type = MsgType.Note Then
|
||||
Dim email As IMail = oConverter.CreateMessage()
|
||||
ListBox1.Items.Add("Attachments: " & email.Attachments.Count)
|
||||
|
||||
ListBox1.Items.Add($"To: " & email.To.First()?.GetMailboxes.First.Address)
|
||||
ListBox1.Items.Add($"From: " & email.From.First()?.GetMailboxes.First.Address)
|
||||
|
||||
For Each oHeader In email.Headers.AllKeys
|
||||
Dim oHeaderValue = email.Headers.Item(oHeader)
|
||||
|
||||
|
||||
ListBox1.Items.Add($"Headers")
|
||||
ListBox1.Items.Add($"Key: {oHeader}, Value: {oHeaderValue}")
|
||||
Next
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
End Class
|
||||
12
GUIs.Test.TestGUI/frmStart.Designer.vb
generated
12
GUIs.Test.TestGUI/frmStart.Designer.vb
generated
@@ -28,6 +28,7 @@ Partial Class frmStart
|
||||
Me.Button4 = New System.Windows.Forms.Button()
|
||||
Me.Button5 = New System.Windows.Forms.Button()
|
||||
Me.Button6 = New System.Windows.Forms.Button()
|
||||
Me.Button7 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Button1
|
||||
@@ -84,6 +85,15 @@ Partial Class frmStart
|
||||
Me.Button6.Text = "DocView"
|
||||
Me.Button6.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button7
|
||||
'
|
||||
Me.Button7.Location = New System.Drawing.Point(254, 12)
|
||||
Me.Button7.Name = "Button7"
|
||||
Me.Button7.Size = New System.Drawing.Size(236, 55)
|
||||
Me.Button7.TabIndex = 0
|
||||
Me.Button7.Text = "Mail"
|
||||
Me.Button7.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmStart
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -94,6 +104,7 @@ Partial Class frmStart
|
||||
Me.Controls.Add(Me.Button4)
|
||||
Me.Controls.Add(Me.Button3)
|
||||
Me.Controls.Add(Me.Button2)
|
||||
Me.Controls.Add(Me.Button7)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Name = "frmStart"
|
||||
Me.Text = "frmStart"
|
||||
@@ -107,4 +118,5 @@ Partial Class frmStart
|
||||
Friend WithEvents Button4 As Button
|
||||
Friend WithEvents Button5 As Button
|
||||
Friend WithEvents Button6 As Button
|
||||
Friend WithEvents Button7 As Button
|
||||
End Class
|
||||
|
||||
@@ -26,4 +26,8 @@ Public Class frmStart
|
||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||
frmDocView.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
frmMail.Show()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user