Jump to content
Ras

Port Scanner (Visual Basic)

Recommended Posts

Posted

Intra in VB si creeaza un proiect nou.

Adauga Winsock Control (apesti CTRL + T si bifezi Winsock Control).

Creeaza 2 textboxes, 2 buttons, 1 timer, 1 listbox, 1 winsock

Primul textbox este pt IP, al doilea textbox pt port, primul buton pt start, al doilea pt stop.

Pune timerul False si pune intervalu 10 sau chiar 1(daca pui 1 are viteza mai mare).

In primul buton scrii:

Private Sub Command1_Click()

Winsock1.RemoteHost = Text1.Text

Winsock1.RemotePort = Text2.Text

Winsock1.Connect

Timer1.Enabled = True

End Sub

In timer scrii:

Private Sub Timer1_Timer()

Winsock1.Close

Text2.Text = Int(Text2.Text) + 1

Winsock1.RemoteHost = Text1.Text

Winsock1.RemotePort = Text2.Text

Winsock1.Connect

End Sub

In winsock scrii:

Private Sub Winsock1_Connect()

List1.AddItem "Port " & Winsock1.RemotePort & " is having a yard sale."

End Sub

In al doilea buton scrii:

Private Sub Command2_Click()

Timer1.Enabled = False

Winsock1.Close

End Sub

This is all!

Bafta!:D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...