Diverses Zugferd

This commit is contained in:
Digital Data - Marlon Schreiber
2019-05-09 11:25:39 +02:00
parent 9e330bd52e
commit 809f8e2b43
9 changed files with 155 additions and 13 deletions

View File

@@ -29,6 +29,9 @@
<setting name="FB_PASS" serializeAs="String">
<value>dd</value>
</setting>
<setting name="MD5Cheksum" serializeAs="String">
<value />
</setting>
</ZUGFeRDTest.My.MySettings>
</userSettings>
<runtime>

View File

@@ -27,6 +27,8 @@ Partial Class Form1
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.txtMD5Checksum = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'OpenFileDialog1
@@ -68,11 +70,31 @@ Partial Class Form1
Me.Button3.Text = "Load Single File"
Me.Button3.UseVisualStyleBackColor = True
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(12, 112)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(221, 23)
Me.Button4.TabIndex = 4
Me.Button4.Text = "MD5Chcksum"
Me.Button4.UseVisualStyleBackColor = True
'
'txtMD5Checksum
'
Me.txtMD5Checksum.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.ZUGFeRDTest.My.MySettings.Default, "MD5Cheksum", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
Me.txtMD5Checksum.Location = New System.Drawing.Point(12, 141)
Me.txtMD5Checksum.Name = "txtMD5Checksum"
Me.txtMD5Checksum.Size = New System.Drawing.Size(360, 20)
Me.txtMD5Checksum.TabIndex = 5
Me.txtMD5Checksum.Text = Global.ZUGFeRDTest.My.MySettings.Default.MD5Cheksum
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(916, 435)
Me.Controls.Add(Me.txtMD5Checksum)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.ListBox1)
@@ -80,6 +102,7 @@ Partial Class Form1
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
@@ -88,4 +111,6 @@ Partial Class Form1
Friend WithEvents ListBox1 As ListBox
Friend WithEvents Button2 As Button
Friend WithEvents Button3 As Button
Friend WithEvents Button4 As Button
Friend WithEvents txtMD5Checksum As TextBox
End Class

View File

@@ -1,5 +1,6 @@
Imports System.IO
Imports System.Reflection
Imports System.Security.Cryptography
Imports System.Text.RegularExpressions
Imports System.Xml
Imports DigitalData.Modules
@@ -100,4 +101,29 @@ Public Class Form1
Console.WriteLine()
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
My.Settings.Save()
Dim result = checkMD5(txtMD5Checksum.Text)
MsgBox("Done")
End Sub
Public Function checkMD5(ByVal filename As String) As String
Try
Dim MD5 As New MD5CryptoServiceProvider
Dim Hash As Byte()
Dim Result As String = ""
Dim Tmp As String = ""
Dim FN As New FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
MD5.ComputeHash(FN)
FN.Close()
Hash = MD5.Hash
Result = Strings.Replace(BitConverter.ToString(Hash), "-", "")
Return Result
Catch ex As Exception
Return Nothing
End Try
End Function
End Class

View File

@@ -95,6 +95,18 @@ Namespace My
Me("FB_PASS") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public Property MD5Cheksum() As String
Get
Return CType(Me("MD5Cheksum"),String)
End Get
Set
Me("MD5Cheksum") = value
End Set
End Property
End Class
End Namespace

View File

@@ -14,5 +14,8 @@
<Setting Name="FB_PASS" Type="System.String" Scope="User">
<Value Profile="(Default)">dd</Value>
</Setting>
<Setting Name="MD5Cheksum" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>