home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD142091262001.psc / Form3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-01-18  |  11.6 KB  |  372 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form mainform 
  4.    AutoRedraw      =   -1  'True
  5.    BackColor       =   &H00BFBFBF&
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "TCP/IP STATION"
  8.    ClientHeight    =   6495
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   8760
  12.    ControlBox      =   0   'False
  13.    Icon            =   "Form3.frx":0000
  14.    LinkTopic       =   "Form3"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    MouseIcon       =   "Form3.frx":0442
  18.    Picture         =   "Form3.frx":074C
  19.    ScaleHeight     =   6495
  20.    ScaleWidth      =   8760
  21.    StartUpPosition =   2  'CenterScreen
  22.    Begin VB.CommandButton Command1 
  23.       BackColor       =   &H00BFBFBF&
  24.       Caption         =   "Quik Scan"
  25.       Default         =   -1  'True
  26.       Height          =   375
  27.       Left            =   120
  28.       Style           =   1  'Graphical
  29.       TabIndex        =   11
  30.       Top             =   3960
  31.       Width           =   975
  32.    End
  33.    Begin VB.ListBox List2 
  34.       BackColor       =   &H00BFBFBF&
  35.       Height          =   255
  36.       ItemData        =   "Form3.frx":79EB
  37.       Left            =   1800
  38.       List            =   "Form3.frx":79ED
  39.       TabIndex        =   10
  40.       Top             =   1080
  41.       Visible         =   0   'False
  42.       Width           =   255
  43.    End
  44.    Begin VB.ListBox List1 
  45.       Appearance      =   0  'Flat
  46.       BackColor       =   &H00BFBFBF&
  47.       CausesValidation=   0   'False
  48.       ForeColor       =   &H00000000&
  49.       Height          =   1200
  50.       ItemData        =   "Form3.frx":79EF
  51.       Left            =   120
  52.       List            =   "Form3.frx":79F1
  53.       MouseIcon       =   "Form3.frx":79F3
  54.       TabIndex        =   9
  55.       Top             =   5160
  56.       Width           =   5295
  57.    End
  58.    Begin MSWinsockLib.Winsock Winsock1 
  59.       Index           =   0
  60.       Left            =   1680
  61.       Top             =   360
  62.       _ExtentX        =   741
  63.       _ExtentY        =   741
  64.       _Version        =   393216
  65.    End
  66.    Begin VB.Timer Timer1 
  67.       Interval        =   500
  68.       Left            =   6240
  69.       Top             =   360
  70.    End
  71.    Begin VB.ListBox ops 
  72.       Appearance      =   0  'Flat
  73.       BackColor       =   &H00BFBFBF&
  74.       CausesValidation=   0   'False
  75.       Height          =   1785
  76.       ItemData        =   "Form3.frx":7CFD
  77.       Left            =   2640
  78.       List            =   "Form3.frx":7CFF
  79.       TabIndex        =   6
  80.       Top             =   1920
  81.       Width           =   3255
  82.    End
  83.    Begin VB.ListBox tasks 
  84.       Appearance      =   0  'Flat
  85.       BackColor       =   &H00BFBFBF&
  86.       CausesValidation=   0   'False
  87.       Height          =   1785
  88.       ItemData        =   "Form3.frx":7D01
  89.       Left            =   240
  90.       List            =   "Form3.frx":7D03
  91.       TabIndex        =   5
  92.       Top             =   1920
  93.       Width           =   2175
  94.    End
  95.    Begin VB.ListBox tasktimes 
  96.       Appearance      =   0  'Flat
  97.       BackColor       =   &H00BFBFBF&
  98.       CausesValidation=   0   'False
  99.       Height          =   1785
  100.       ItemData        =   "Form3.frx":7D05
  101.       Left            =   6120
  102.       List            =   "Form3.frx":7D07
  103.       TabIndex        =   4
  104.       Top             =   1920
  105.       Width           =   2295
  106.    End
  107.    Begin VB.CommandButton runbutt 
  108.       BackColor       =   &H00BFBFBF&
  109.       Caption         =   "Run task"
  110.       Height          =   375
  111.       Left            =   3600
  112.       Style           =   1  'Graphical
  113.       TabIndex        =   3
  114.       Top             =   3960
  115.       Width           =   975
  116.    End
  117.    Begin VB.CommandButton addbutt 
  118.       BackColor       =   &H00BFBFBF&
  119.       Caption         =   "Add Scheduled Task"
  120.       Height          =   375
  121.       Left            =   1920
  122.       Style           =   1  'Graphical
  123.       TabIndex        =   2
  124.       Top             =   3960
  125.       Width           =   1695
  126.    End
  127.    Begin VB.CommandButton Command2 
  128.       BackColor       =   &H00BFBFBF&
  129.       Caption         =   "Remove Task"
  130.       Height          =   375
  131.       Left            =   4560
  132.       Style           =   1  'Graphical
  133.       TabIndex        =   1
  134.       Top             =   3960
  135.       Width           =   1215
  136.    End
  137.    Begin VB.CommandButton endbutt 
  138.       Appearance      =   0  'Flat
  139.       BackColor       =   &H00BFBFBF&
  140.       Caption         =   "X"
  141.       BeginProperty Font 
  142.          Name            =   "MS Sans Serif"
  143.          Size            =   8.25
  144.          Charset         =   0
  145.          Weight          =   700
  146.          Underline       =   0   'False
  147.          Italic          =   0   'False
  148.          Strikethrough   =   0   'False
  149.       EndProperty
  150.       Height          =   255
  151.       Left            =   8280
  152.       MaskColor       =   &H00BFBFBF&
  153.       Style           =   1  'Graphical
  154.       TabIndex        =   0
  155.       Top             =   240
  156.       Width           =   255
  157.    End
  158.    Begin VB.Label Label4 
  159.       AutoSize        =   -1  'True
  160.       BackStyle       =   0  'Transparent
  161.       Caption         =   ".... More Stuff to go in here laters"
  162.       Height          =   195
  163.       Left            =   6120
  164.       TabIndex        =   13
  165.       Top             =   5280
  166.       Width           =   2310
  167.    End
  168.    Begin VB.Label Label3 
  169.       AutoSize        =   -1  'True
  170.       BackStyle       =   0  'Transparent
  171.       Caption         =   "Open Ports / Data Returned"
  172.       Height          =   195
  173.       Left            =   600
  174.       TabIndex        =   12
  175.       Top             =   4800
  176.       Width           =   2010
  177.    End
  178.    Begin VB.Line Line2 
  179.       BorderColor     =   &H00E0E0E0&
  180.       X1              =   120
  181.       X2              =   8520
  182.       Y1              =   4690
  183.       Y2              =   4690
  184.    End
  185.    Begin VB.Line Line1 
  186.       X1              =   120
  187.       X2              =   8520
  188.       Y1              =   4680
  189.       Y2              =   4680
  190.    End
  191.    Begin VB.Label Label2 
  192.       AutoSize        =   -1  'True
  193.       BackStyle       =   0  'Transparent
  194.       Caption         =   "00:00:00 MM"
  195.       Height          =   195
  196.       Left            =   7200
  197.       TabIndex        =   8
  198.       Top             =   4080
  199.       Width           =   945
  200.    End
  201.    Begin VB.Label Label1 
  202.       AutoSize        =   -1  'True
  203.       BackStyle       =   0  'Transparent
  204.       Caption         =   "Current Time:"
  205.       Height          =   195
  206.       Left            =   6000
  207.       TabIndex        =   7
  208.       Top             =   4080
  209.       Width           =   945
  210.    End
  211. Attribute VB_Name = "mainform"
  212. Attribute VB_GlobalNameSpace = False
  213. Attribute VB_Creatable = False
  214. Attribute VB_PredeclaredId = True
  215. Attribute VB_Exposed = False
  216. Public itemno As Integer
  217. Public Go As Boolean
  218. Public GoS As Boolean
  219. Public oldx
  220. Public oldy
  221. Public iporT
  222. Public Sub TimeOut(Duration As Double)
  223.     ' standard timeout sub, causes a short pause in the code
  224.     Dim StartTime As Double, x As Integer
  225.     StartTime = Timer
  226.     Do While Timer - StartTime < Duration
  227.         x = DoEvents()
  228.     Loop
  229. End Sub
  230. Private Sub addbutt_Click()
  231. addbutt.Enabled = False
  232. List1.clear
  233. List1.AddItem "", 0
  234. List2.clear
  235. Load addtask
  236. addtask.Visible = True
  237. End Sub
  238. Private Sub Command1_Click()
  239. List1.clear
  240. qs.Text1.Text = ""
  241. qs.Text2.Text = ""
  242. qs.Text3.Text = ""
  243. addtask.startport = Null
  244. addtask.stopport = Null
  245. Load qs
  246. qs.Visible = True
  247. End Sub
  248. Private Sub Command2_Click()
  249. changerr = tasks.ListIndex
  250. If changerr = -1 Then
  251. MsgBox "Select a valid task before trying to remove it!", vbOKOnly, "IDIOT!"
  252. ElseIf changerr = 0 Then
  253. MsgBox "Select a valid task before trying to remove it!", vbOKOnly, "IDIOT!"
  254. tasks.RemoveItem changerr
  255. ops.RemoveItem changerr
  256. tasktimes.RemoveItem changerr
  257. End If
  258. End Sub
  259. Private Sub endbutt_Click()
  260. If tasks.ListCount > 1 Then
  261. decide = MsgBox("Exiting will delete your scheduled tasks.  Do you want to continue?", vbYesNo, "Exit?")
  262. If decide = 6 Then End
  263. End If
  264. End Sub
  265. Private Sub Form_Load()
  266. ops.AddItem "Code Master: Cory Forsythe", 0
  267. tasks.AddItem "TCP/IP King V:1.0", 0
  268. tasktimes.AddItem "Written@December,2000", 0
  269. itemno = 0
  270. GoS = False
  271. End Sub
  272. Private Sub List1_Click()
  273. MsgBox List1.List(List1.ListIndex), vbOKOnly, " "
  274. End Sub
  275. Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  276. If login_data = True Then
  277. Winsock1(Index).GetData Data, vbString
  278. List1.AddItem Winsock1(Index).RemotePort & "    RETURNS:: " & Data
  279. List2.AddItem ""
  280. List1.AddItem ""
  281. List2.AddItem ""
  282. Open App.Path & "\Scanner log.txt" For Append As #2
  283. Write #2, Winsock1(Index).RemotePort & " RETURNS::   " & Data
  284. Close #2
  285. End If
  286. End Sub
  287. Private Sub Winsock1_Connect(Index As Integer)
  288. If Winsock1(Index).RemotePort = 8080 Then
  289. List1.AddItem "PROXY SERVER FOUND"
  290. List1.AddItem "Port " & Winsock1(Index).RemotePort & " is open"
  291. Open App.Path & "\Scanner log.txt" For Append As #4
  292. Write #4, "Port " & Winsock1(Index).RemotePort & " is open"
  293. Close #4
  294. End If
  295. End Sub
  296. Private Sub Winsock1_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  297. destroy Winsock1(Index)
  298. End Sub
  299. Public Sub destroy(obj As Object)
  300. TimeOut 1
  301. Unload obj
  302. TimeOut 1
  303. End Sub
  304. Private Sub ops_Click()
  305. tasks.Selected(ops.ListIndex) = True
  306. tasktimes.Selected(ops.ListIndex) = True
  307. End Sub
  308. Private Sub runbutt_Click()
  309. changer = tasks.ListIndex
  310. If changer = -1 Then
  311. MsgBox "Select a valid task before trying to run it!", vbOKOnly, "IDIOT!"
  312. ElseIf changer = 0 Then
  313. MsgBox "Select a valid task before trying to run it!", vbOKOnly, "IDIOT!"
  314. tasktimes.RemoveItem changer
  315. tasktimes.AddItem "Egaged", changer
  316. RUNTASK changer, tasks.List(changer), ops.List(chagner)
  317. tasks.RemoveItem changer
  318. ops.RemoveItem changer
  319. tasktimes.RemoveItem changer
  320. End If
  321. End Sub
  322. Private Sub tasks_Click()
  323. tasktimes.Selected(tasks.ListIndex) = True
  324. ops.Selected(tasks.ListIndex) = True
  325. End Sub
  326. Private Sub tasktimes_Click()
  327. tasks.Selected(tasktimes.ListIndex) = True
  328. ops.Selected(tasktimes.ListIndex) = True
  329. End Sub
  330. Private Sub Timer1_Timer()
  331. If IsNetConnectOnline() = True Then
  332. If Not List1.List(0) = "External Scan Ready..." Then
  333. 'List1.RemoveItem 0
  334. List1.AddItem "External Scan Ready...", 0
  335. End If
  336. ElseIf IsNetConnectOnline() = False Then
  337. If Not List1.List(0) = "External Scan NOT Ready..." Then
  338. List1.AddItem "External Scan NOT Ready...", 0
  339. End If
  340. End If
  341. Label2.Caption = Time
  342. i = 1
  343. For i = 1 To tasktimes.ListCount
  344. '' this will run the current procedure
  345. If tasktimes.List(i) = Time Then
  346. RUNTASK i, tasks.List(i), ops.List(i)
  347. tasks.RemoveItem i
  348. ops.RemoveItem i
  349. tasktimes.RemoveItem i
  350. ElseIf tasktimes.List(i) = "N/A" Then
  351. tasktimes.RemoveItem i
  352. tasktimes.AddItem "Engaged", i
  353. RUNTASK i, tasks.List(i), ops.List(i)
  354. tasks.RemoveItem i
  355. ops.RemoveItem i
  356. tasktimes.RemoveItem i
  357. End If
  358. Next i
  359. End Sub
  360. Private Sub Winsock2_Connect()
  361. Go = False
  362. List1.AddItem "Connected to:" & Winsock2.RemoteHost & "(" & Winsock2.RemoteHostIP & ")" & ":" & Winsock2.RemotePort
  363. End Sub
  364. Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
  365. Winsock2.GetData Data, vbString
  366. List1.AddItem Data
  367. End Sub
  368. Private Sub Winsock2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  369. If Number = Number Then
  370. End If
  371. End Sub
  372.