?? frm1.frm
字號:
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "收到的數(shù)據(jù):"
Height = 180
Index = 3
Left = 5880
TabIndex = 33
Top = 2760
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "收到的數(shù)據(jù):"
Height = 180
Index = 2
Left = 5880
TabIndex = 32
Top = 720
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "收到的數(shù)據(jù):"
Height = 180
Index = 1
Left = 1080
TabIndex = 29
Top = 2760
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "收到的數(shù)據(jù):"
Height = 180
Index = 0
Left = 1080
TabIndex = 26
Top = 720
Width = 1080
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "收到的數(shù)據(jù)(字符串):"
Height = 180
Left = 240
TabIndex = 18
Top = 4800
Width = 1980
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "MODEM-D:"
Height = 180
Left = 5040
TabIndex = 15
Top = 2760
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "MODEM-C:"
Height = 180
Left = 5040
TabIndex = 13
Top = 720
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "MODEM-B:"
Height = 180
Left = 240
TabIndex = 11
Top = 2760
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "待發(fā)送的數(shù)據(jù):"
Height = 180
Left = 4560
TabIndex = 10
Top = 240
Width = 1260
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "對方號碼:"
Height = 180
Left = 120
TabIndex = 3
Top = 240
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "MODEM-A:"
Height = 180
Left = 240
TabIndex = 2
Top = 720
Width = 810
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'得到計算機的名稱
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Dim receive_str$
Dim read1$
Dim read2$
Dim read3$
Dim read4$
Private Sub Command1_Click()
MSComm1(0).Output = "ATH0" & vbCrLf
MSComm1(0).PortOpen = False
'MSComm2.Output = "ATH0" & vbCrLf
'MSComm2.PortOpen = False
'
'MSComm1(2).Output = "ATH0" & vbCrLf
'MSComm1(2).PortOpen = False
'MSComm4.Output = "ATH0" & vbCrLf
'MSComm4.PortOpen = False
End
End Sub
Private Sub Command10_Click()
MSComm4.Output = "+++"
MSComm4.Output = "ATH0" & vbCrLf
End Sub
Private Sub Command11_Click()
TextD.Text = ""
End Sub
Private Sub Command12_Click()
a = SOH
Text4.Text = ""
Text8.Text = ""
End Sub
Private Sub Command13_Click()
Dim send_bye(1 To 12) As Byte
send_bye(1) = &H24
send_bye(2) = &H1B
send_bye(3) = &H0
send_bye(4) = &H1
send_bye(5) = &HC4
send_bye(6) = &H12
send_bye(7) = &H0
send_bye(8) = &H0
send_bye(9) = &H0
send_bye(10) = &HD7
send_bye(11) = &H24
send_bye(12) = &H24
MSComm1(0).Output = send_bye() ' Text1.Text & Chr$(13)
End Sub
Private Sub Command14_Click()
MSComm2.Output = Text5.Text
End Sub
Private Sub Command15_Click()
MSComm3.Output = Text6.Text
End Sub
Private Sub Command16_Click()
MSComm4.Output = Text7.Text
End Sub
Private Sub Command2_Click()
MSComm1(0).Output = "ATDT" & Trim(Text2.Text) & vbCrLf
End Sub
Private Sub Command3_Click()
TextA.Text = ""
End Sub
Private Sub Command4_Click()
MSComm1(0).Output = "+++"
MSComm1(0).Output = "ATH0" & vbCrLf
End Sub
Private Sub Command5_Click()
MSComm1(0).Output = Text3.Text
End Sub
Private Sub Command6_Click()
MSComm2.Output = "+++"
MSComm2.Output = "ATH0" & vbCrLf
End Sub
Private Sub Command7_Click()
TextB.Text = ""
End Sub
Private Sub Command8_Click()
MSComm3.Output = "+++"
MSComm3.Output = "ATH0" & vbCrLf
End Sub
Private Sub Command9_Click()
TextC.Text = ""
End Sub
Private Sub Form_Load()
'得到計算機的名稱
Dim name As String
Dim Length As Long
Length = 225
name = String(Length, Chr(0))
GetComputerName name, Length
name = Left(name, Length)
computername = name
''臨時的計算機名稱
computername = "123456"
'********************
'Call MakeConnection
Form1.Top = 800
Form1.Left = 2300
TextA.Text = ""
TextB.Text = ""
TextC.Text = ""
TextD.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
MSComm1(0).CommPort = 2
MSComm1(0).PortOpen = True
'MSComm1(0).Output = "ATS0=1" & vbCrLf
'MSComm1(0).Output = "ats10=1" & vbCrLf
'MSComm1(0).Output = "ats38=0" & vbCrLf
'對其他三個MODEM的設(shè)置
'MSComm2.CommPort = 3
'MSComm2.PortOpen = True
'MSComm2.Output = "ATS0=1" & vbCrLf
'MSComm2.Output = "ats10=1" & vbCrLf
'MSComm2.Output = "ats38=0" & vbCrLf
'
'
'MSComm1(2).CommPort = 4
'MSComm1(2).PortOpen = True
'MSComm1(2).Output = "ATS0=1" & vbCrLf
'MSComm1(2).Output = "ats10=1" & vbCrLf
'MSComm1(2).Output = "ats38=0" & vbCrLf
'
'MSComm4.CommPort = 5
'MSComm4.PortOpen = True
'MSComm4.Output = "ATS0=1" & vbCrLf
'MSComm4.Output = "ats10=1" & vbCrLf
'MSComm4.Output = "ats38=0" & vbCrLf
End Sub
Private Sub MSComm1_OnComm(Index As Integer)
m_id = Index
Select Case MSComm1(Index).CommEvent
Case comEvReceive ' 收到 RThreshold # of
t = GetTickCount()
Do
DoEvents
Loop Until GetTickCount - t >= 100
'接收數(shù)據(jù)
Call read
End Select
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
MSComm1(0).Output = "ATDT" & Trim(Text2.Text) & vbCrLf
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -