View Single Post
Old 11-16-2007, 04:46 PM   #6
Derkel
N00B Pwner
 
Last Online: 10-07-2009 10:14 PM
Join Date: Apr 2007
Location: In a House
Posts: 453
Rep Power: 3
Rep Points: 10
Derkel is on a distinguished road
Feedback: (2)
Points: 7,615.51
Bank: 38,432.60
Total Points: 46,048.11
Autism - Derkel 
Xfire derkel
Re: Mega Post of Tuts

How to Make a Port Scanner
Add 2 text boxes, 3 command buttons, a list box, a timer, and a winsock control (if you dont have the winsock button on your component bar, you can add it by right clicking on the bar and scrolling to components, and adding it from the component list, it should be called "Microsoft Winsock Control 6.0 (SP6))
Add the following code to your form:
Code:
Private Sub Form_Load()
Timer1.Interval = 1
Timer1.Enabled = False
Text2.Text = "0"
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
Winsock1.Close
Text2.Text = Text2.Text + 1
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
Winsock1.Connect
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Text2.Text = "0"
End Sub
Private Sub Command3_Click()
List1.Clear
End Sub
Private Sub Winsock1_Connect()
List1.AddItem Winsock1.RemotePort & " is open!"
End Sub
As you can see your first command button is to start the scan, the second is to stop the scan, and the third one is to clear the ports.


Last edited by Derkel; 11-16-2007 at 04:55 PM.
Derkel is offline   Reply With Quote