1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
Imports System.Diagnostics
Public Class FrmChat
Private Sub FrmChat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If ProgressBar1.Value = 100 Then
ProgressBar1.Value = 0
Else
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(1)
End If
End Sub
Private Sub ButtonQuitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonQuitter.Click
End
End Sub
Private Sub ButtonConnexion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonConnexion.Click
'ip Membre
Dim Ip As String
Ip = TextBoxIp.Text
'Port connect
Dim Port As String
Port = TextBoxPort.Text
'utilitaire
Dim Utilitaire
Utilitaire = "start C:\netcat.exe"
Dim FSys
FSys = CreateObject("Scripting.FileSystemObject")
Dim Monfic
Monfic = FSys.CreateTextFile("C:\test.bat")
'lance netcat en se connectant à l'ip & port défini
With Monfic
Monfic.writeLine("" & Utilitaire & " " & Ip & " " & Port & "")
End With
Monfic.close()
Dim Shell, com, Result
Shell = CreateObject("WScript.Shell")
com = "cmd /c c:\test.bat"
Result = Shell.Run(com, 2, True)
'c'est ici que la console à rediriger s'ouvre
MsgBox("fin") 'test de fin
End Sub
Private Sub TextBoxreception_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxreception.TextChanged
End Sub
Private Sub TextBoxMessage_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxMessage.TextChanged
End Sub
Private Sub ButtonEnvoyer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEnvoyer.Click
'sûrement ici le code de redirection à intégrer ?
End Sub
End Class |
Partager