⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 加上一个GSM模块
💻 BAS
字号:
Attribute VB_Name = "Module1"
Public UserName As String
Public password As String

Public intPort As Integer
Public strSet As String
Public strCh As String

Public arr_return() As Variant
Public arr_return1() As Variant
Public arr_return11() As Variant
Public arr_return2() As Variant
Public arr_return21() As Variant
Public arr_return3() As Variant
Public arr_return4() As Variant
Public mess_index() As Variant
Public mess_index1() As Variant

Public intall As Integer
Public intall1 As Integer
Public intall2 As Integer

Public Flag As Boolean

Public sendStr As String
Public sendstr1 As String
Public receiveStr As String
Public smsAll As String
Public receiveStr1 As String
Public receiveStr2 As String
Public receiveStr3 As String
Public receiveStr4 As String
Public receiveStr6 As String

Public phoneNum As String
Public phoneTime As String

Public backValue As Double
Public Count3 As Integer
Public Count4 As Integer
Public no As Integer

Public SetFlag1 As Boolean 'set the control centre num
Public SetFlag2 As Boolean 'set the turner num

Public ClientStr As String
Public sim_NUM As String
Public TXT() As String
Public NUM As Integer
Public Count5 As Integer
Public COUNT6 As Integer
'************************************************
Public newFlag As Boolean
Public newCount As Integer
Public newSub As Integer
Public newNo(20) As Integer
Public newCount4(20) As Integer
Public noFlag As Boolean
Public newData As Boolean
'************************************************
Public delCount As Integer


Public Function Check_Password(ByVal UserName As String, ByVal password As String) As Byte
    On Error GoTo gpError
    Dim objCn As New Connection
    Dim objRs As New Recordset
    Dim strCn As String, strSQL As String
    objCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Program Files\smscomm\Info.mdb"
    objCn.Open
    strSQL = "select UserOfPassword from UserInfo where UserOfName='" & UserName & "'"
    Set objRs.ActiveConnection = objCn
    objRs.Open strSQL
    If objRs.EOF Then
        Check_Password = 0
    Else
        If password <> Trim(objRs.Fields("userofpassword").Value) Then
            Check_Password = 1
        Else
            Check_Password = 2
        End If
    End If
    objCn.Close
    Set objRs = Nothing
    Set objCn = Nothing
    Exit Function
gpError:
    Check_Password = 255
End Function
Public Function InData(ByVal UserName As String, ByVal password As String, ByVal oldName) As Byte
    'On Error GoTo gpError
    Dim s1, s2, s3 As String
    s1 = UserName
    s2 = password
    s3 = oldName
    Dim objCn As New Connection
    Dim objRs As New Recordset
    Dim strCn As String, strSQL As String, strSQL1 As String
    objCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Program Files\smscomm\Info.mdb"
    objCn.Open
    strSQL = "update UserInfo set UserOfName='" & s1 & "',UserOfPassword='" & s2 & "' where UserOfName='" & s3 & "'"
    Set objRs.ActiveConnection = objCn
    objRs.Open strSQL
    objCn.Close
    Set objRs = Nothing
    Set objCn = Nothing
    Exit Function
'gpError:
    'MsgBox "修改信息失败", vbOKOnly, "通知"
End Function

Public Function Check_Client(ByVal phoneNum As String) As Byte
    'On Error GoTo gpError
    Dim objCn As New Connection
    Dim objRs As New Recordset
    Dim strCn As String, strSQL As String
    objCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Program Files\smscomm\Info.mdb"
    objCn.Open
    strSQL = "select * from UPSINFO where SIMNUM='" & phoneNum & "'"
    Set objRs.ActiveConnection = objCn
    objRs.Open strSQL
    
    If objRs.EOF Then
         Check_Client = 0
    Else
         objRs.MoveFirst
         Check_Client = 1
         If objRs.Fields("CLIENT") <> "" Then
            ClientStr = objRs.Fields("CLIENT")
         Else
            ClientStr = "未知"
         End If
    End If
    objCn.Close
    Set objRs = Nothing
    Set objCn = Nothing
    Exit Function
'gpError:
    'Check_Client = 255
End Function
Public Function Get_Sim(ByVal cmbClient As String) As Byte
    'On Error GoTo gpError
    Dim objCn As New Connection
    Dim objRs As New Recordset
    Dim strCn As String, strSQL As String
    objCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Program Files\smscomm\Info.mdb"
    objCn.Open
    strSQL = "select * from UPSINFO where CLIENT='" & cmbClient & "'"
    Set objRs.ActiveConnection = objCn
    objRs.Open strSQL
    
    If objRs.EOF Then
         Get_Sim = 0
    Else
         objRs.MoveFirst
         Get_Sim = 1
         If objRs.Fields("SIMNUM") <> "" Then
            sim_NUM = objRs.Fields("SIMNUM")
         Else
            sim_NUM = "00000000000"
        End If
    End If
    objCn.Close
    Set objRs = Nothing
    Set objCn = Nothing
    'Exit Function
'gpError:
    'Check_Client = 255
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -