📄 tcppro2.frm
字号:
ReadOnly = -1 'True
ScrollBars = 2
TextRTF = $"tcppro2.frx":037A
End
Begin InetCtlsObjects.Inet Inet1
Left = -68400
Top = 660
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
End
Begin VB.Label Label13
Caption = "What is my..."
Height = 255
Left = -74880
TabIndex = 34
Top = 1260
Width = 975
End
Begin VB.Label Label12
Caption = "TCP Pro current version:"
Height = 255
Left = -74160
TabIndex = 33
Top = 900
Width = 1935
End
Begin VB.Label Label11
Caption = "The other computer is known as:"
Height = 255
Left = -74160
TabIndex = 32
Top = 540
Width = 2415
End
Begin VB.Image Image5
BorderStyle = 1 'Fixed Single
Height = 540
Left = -74760
Picture = "tcppro2.frx":044F
Top = 540
Width = 540
End
Begin VB.Image Image2
BorderStyle = 1 'Fixed Single
Height = 540
Left = 240
Picture = "tcppro2.frx":0759
Top = 540
Width = 540
End
Begin VB.Label Label1
Caption = $"tcppro2.frx":0A63
Height = 615
Left = 840
TabIndex = 24
Top = 540
Width = 6615
End
Begin VB.Label Label2
Caption = $"tcppro2.frx":0B4D
Height = 855
Left = 240
TabIndex = 23
Top = 1140
Width = 7215
End
Begin VB.Line Line1
X1 = 120
X2 = 7440
Y1 = 4680
Y2 = 4680
End
Begin VB.Label Label4
Caption = $"tcppro2.frx":0CF1
Height = 495
Left = 120
TabIndex = 22
Top = 4800
Width = 7335
End
Begin VB.Label Label5
Caption = "Please enter the appropriate information below:"
Height = 255
Left = -74160
TabIndex = 21
Top = 600
Width = 6615
End
Begin VB.Label Label6
Caption = "Are you going to be the server or the client?"
Height = 255
Left = -74160
TabIndex = 20
Top = 900
Width = 3135
End
Begin VB.Label lblstatus
BorderStyle = 1 'Fixed Single
Caption = $"tcppro2.frx":0DA5
Height = 855
Left = -74880
TabIndex = 19
Top = 4380
Width = 7335
End
Begin VB.Label Label10
Caption = "Message:"
Height = 255
Left = -74160
TabIndex = 18
Top = 660
Width = 735
End
Begin VB.Image Image4
BorderStyle = 1 'Fixed Single
Height = 540
Left = -74760
Picture = "tcppro2.frx":0E6B
Top = 540
Width = 540
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 540
Left = -74760
Picture = "tcppro2.frx":1175
Top = 540
Width = 540
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd1_Click()
Winsock3.LocalPort = txt1.Text
Winsock3.Listen
Frame3.Visible = False
t1.Visible = True
t2.Visible = True
t3.Visible = True
t4.Visible = True
t5.Visible = True
t6.Visible = True
t7.Visible = True
t8.Visible = True
t9.Visible = True
t10.Visible = True
t11.Visible = True
t12.Visible = True
t13.Visible = True
t14.Visible = True
End Sub
Private Sub cmd2_Click()
Winsock3.RemoteHost = txt2.Text
Winsock3.RemotePort = txt3.Text
Winsock3.Connect
Frame3.Visible = False
t1.Visible = True
t2.Visible = True
t3.Visible = True
t4.Visible = True
t5.Visible = True
t6.Visible = True
t7.Visible = True
t8.Visible = True
t9.Visible = True
t10.Visible = True
t11.Visible = True
t12.Visible = True
t13.Visible = True
t14.Visible = True
End Sub
Private Sub Command1_Click()
On Error GoTo err:
Winsock1.SendData "Other user disconnected!"
Winsock1.Close
Frame1.Enabled = True
Frame2.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
SSTab1.Tab = 0
Exit Sub
err:
txtstatus.Text = txtstatus.Text & err.Description & " - Error number: " & err.Number & vbCrLf
txtstatus.SelStart = Len(txtstatus.Text)
End Sub
Private Sub cmdconnect_Click()
On Error GoTo err:
Winsock1.RemoteHost = txtserverip.Text
Winsock1.RemotePort = txtclientport.Text
Winsock1.Connect
SSTab1.Tab = 2
txtmsg.SetFocus
Frame1.Enabled = False
Frame2.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Exit Sub
err:
txtstatus.Text = txtstatus.Text & err.Description & " - Error number: " & err.Number & vbCrLf
txtstatus.SelStart = Len(txtstatus.Text)
End Sub
Private Sub cmdlisten_Click()
On Error GoTo err:
Winsock1.LocalPort = txtserverport.Text
Winsock1.Listen
SSTab1.Tab = 2
txtmsg.SetFocus
Frame1.Enabled = False
Frame2.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Exit Sub
err:
txtstatus.Text = txtstatus.Text & err.Description & " - Error number: " & err.Number & vbCrLf
txtstatus.SelStart = Len(txtstatus.Text)
End Sub
Private Sub Command16_Click()
End Sub
Private Sub Command2_Click()
If txtCHAT.Text <> "" Then
CommonDialog1.Filter = "Text files (*.txt)|*.txt"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As #1
Print #1, txtCHAT.Text
Close #1
End If
End If
End Sub
Private Sub Command3_Click()
If txtmsg.Text <> "" Then
On Error GoTo err:
Winsock1.SendData txtmsg.Text
txtCHAT.Text = txtCHAT.Text & "Me: " & txtmsg.Text & vbCrLf
txtmsg.Text = ""
txtCHAT.SelStart = Len(txtCHAT.Text)
End If
Exit Sub
err:
txtstatus.Text = txtstatus.Text & err.Description & " - Error number: " & err.Number & vbCrLf
txtstatus.SelStart = Len(txtstatus.Text)
End Sub
Private Sub Command4_Click()
On Error GoTo err:
If Inet1.OpenURL("http://www.nowresources.com/directchat/version.txt") > App.Major & App.Minor & App.Revision Then
Dim prompt As String
Dim reply As Integer
prompt = MsgBox("There is an upgrade to a new version available on the NOW Resources server.", vbExclamation)
MsgBox "Do you want to download it now?", vbYesNo, "Download now?"
If reply = vbNo Then
Exit Sub
Else
'get download from server...
'start download
Dim strURL As String
Dim bData() As Byte ' Data variable
Dim intFile As Integer ' FreeFile variable
strURL = _
"www.nowresources.com/danoph/setup.zip"
intFile = FreeFile() ' Set intFile to an unused
' file.
' The result of the OpenURL method goes into the Byte
' array, and the Byte array is then saved to disk.
bData() = Inet1.OpenURL(strURL, icByteArray)
Open App.Path & "setup.zip" For Binary Access Write _
As #intFile
Put #intFile, , bData()
Close #intFile
End If
Else
MsgBox "There are no upgrades to your current version.", vbExclamation
End If
err:
End Sub
Private Sub Command5_Click()
SSTab1.Tab = 1
Option1.Value = True
Option2.Value = False
On Error GoTo err:
txtserverport.SetFocus
txtserverport.SelStart = 0
txtserverport.SelLength = Len(txtserverport.Text)
err:
End Sub
Private Sub Command6_Click()
SSTab1.Tab = 2
txtmsg.SetFocus
End Sub
Private Sub Command7_Click()
End Sub
Private Sub Form_Load()
txtversion.Text = App.Major & "." & App.Minor & "." & App.Revision
txtlocal.Text = "Local Host Name (networking name): " & Winsock1.LocalHostName _
& vbCrLf & "Local IP Address: " & Winsock1.LocalIP & vbCrLf _
& "Local Port: " & Winsock1.LocalPort & vbCrLf _
& vbCrLf & "---------What is---------" & vbCrLf & vbCrLf _
& "An IP address?" & vbCrLf & "An IP address is the address you use when you are online; your computer's online address. Other computers " _
& "can talk to you using this IP address. Your LOCAL IP address is listed above, but you need to check your internet connection settings in your ISP's dialer for your IP address." _
& vbCrLf & vbCrLf & "A Port?" & vbCrLf & "A port is space in your computer reserved for connecting to other computers. Most computers have 5000+ ports on their computer. For example, TCP Pro asks the server for the port to 'listen' on, and you have to connect to that port so you can chat using TCP Pro." & vbCrLf & vbCrLf & "TCP Pro2 Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -