Translate

Montag, 29. Juni 2015

Wincrypt-Projekt



AES-FileCryptor

AES-FileCryptor





A programm to encrypt/ decrypt files with AES.
Ein Programm, um Dateien mit AES zu ent-/ verschlüsseln.
Download (GDrive)
Download (Dropbox)
Download (Sourceforge)

Lizenz
Manual (Englisch) 
Manual (Deutsch)  

Plattform: Windows mit .Net 4.5.1 

Error-Logging in VB.Net

Public Sub WriteToLog(ByVal Text As String)
        Try
            If System.IO.Directory.Exists(System.AppDomain.CurrentDomain.BaseDirectory() & "log\") = False Then
                System.IO.Directory.CreateDirectory(System.AppDomain.CurrentDomain.BaseDirectory() & "log\") 'Verzeichnis erstellen
            End If
            'Datum anpassen
            Dim CurrentDate_Month As String = ""
            If DateTime.Today.Month < 10 Then
                CurrentDate_Month = "0" & DateTime.Today.Month
            Else
                CurrentDate_Month = DateTime.Today.Month
            End If
            Dim CurrentDate_Day As String = ""
            If DateTime.Today.Day < 10 Then
                CurrentDate_Day = "0" & DateTime.Today.Day
            Else
                CurrentDate_Day = DateTime.Today.Day
            End If
            'Dateipfad anlegen:
            Dim Dateipfad As String = System.AppDomain.CurrentDomain.BaseDirectory() & "log\" & DateTime.Today.Year & "_" & CurrentDate_Month & "_" & CurrentDate_Day & "_" & ".txt"
            If System.IO.File.Exists(Dateipfad) = False Then
                Using LogFile As FileStream = File.Create(Dateipfad, 200, FileOptions.Asynchronous)
                    LogFile.Close()
                End Using
            End If
            'Datei öffnen
            Dim fs As FileStream = New FileStream(Dateipfad, FileMode.Append, FileAccess.Write)
            'Stream öffnen
            Dim w As StreamWriter = New StreamWriter(fs)
            'Anfügen am Ende
            w.BaseStream.Seek(0, SeekOrigin.End)
            'Zeilen schreiben
            w.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
            'Daten anpassen für Log:
            w.WriteLine(CurrentDate_Day & "." & CurrentDate_Month & "." & DateTime.Today.Year & "-" & TimeOfDay)
            w.Write(Text)
            w.WriteLine()
            'Writer und Stream schließen
            w.Close()
            fs.Close()
        Catch ex As Exception
            MessageBox.Show(ex.ToString) 'Fehlermeldung ausgeben
        End Try
    End Sub

Freitag, 12. Juni 2015

Visual Basic 6 Tastendruck abfangen

If KeyCode = vbKeyEnter Then
        Call Command_Berechne_Click   'Button-Klick aufrufen
    End If



Visual Basic Forum



Donnerstag, 4. Juni 2015

Visual Basic .Net TCPCam.dll Howto

Howto:

Visual Basic .Net Strings.Split

Dim Lines() = temp.Split(New [Char]() {":"c})

Visual Basic .Net IP-Kamera-Connect

The TCPCam Class

Instead of using the TCPCam ActiveX you can use the TCPCam class which can be found on the extracted rar file on this path:
"TCPCam\TCPCam\TCPCam\bin\Release" just add a reference to your project with the "TCPCam.dll" file. You need a picturebox to display the camera frames on. Declare your camera object before you continue:
Code:
Dim Webcam As New TCPCam.Host(Picturebox,Port)
or as a client:
Code:
Dim Webcam As New TCPCam.Client(Picturebox)
With this class you can use the SendImage method to send images to the host, not just camera frames. 

Download: GDrive

Visual Basic .Net Form-Resize-Event



Visual Basic .Net Bildschirmgröße auslesen/ ermitteln-Bildschirmauflösung auslesen/ ermitteln


Visual Basic .Net Form Autoresize


Usenet-Suche



Montag, 1. Juni 2015

Visual Basic .Net Ordner erstellen, wenn noch nicht existiert


If System.IO.Directory.Exists("C:\test") = False Then
     System.IO.Directory.CreateDirectory("C:\test")
End If

Visual Basic .Net Color RGB to HTML-Color (HEX)

http://lateral8.com/articles/2010/2/2/how-to-convert-rgb-to-hexadecimal-code-in-net.aspx

string htmlString = System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(70, 90, 155));

Visual Basic .Net Copy Paste in Textbox verhindern

In den Designer gehen --> Textbox anwählen --> ShortcutsEnabled auf "false" setzen