生成隨機IP工具的VB代碼 Private Sub Form_Load() Dim fso As New FileSystemObject Dim a, b, c, d As Integer Dim ph, e As String ph = App.Path & "\" & "ip.txt" Randomize a = Int(253 * Rnd + 1) b = Int(253 * Rnd + 1) c = Int(240 * Rnd + 1) Open ph For Output As #1 For i = c To c + 7 For j = 1 To 254 e = a & "." & b & "." & i & "." & j Print #1, e DoEvents Next j Next i Close #1 Unload Me End Sub