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

📄 form1.frm

📁 VB 与232串口的通讯 VB 与232串口的通讯
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Begin VB.Form Form1 
   Caption         =   "MKECOM 参数配置"
   ClientHeight    =   9615
   ClientLeft      =   285
   ClientTop       =   975
   ClientWidth     =   14760
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9615
   ScaleWidth      =   14760
   Begin VB.TextBox Text_ip 
      Height          =   270
      Left            =   4320
      TabIndex        =   6
      Text            =   "http://192.168.0.236"
      Top             =   120
      Width           =   8775
   End
   Begin VB.CommandButton Command_Openurl 
      Caption         =   "转到"
      Height          =   375
      Left            =   13560
      TabIndex        =   5
      Top             =   120
      Width           =   855
   End
   Begin SHDocVwCtl.WebBrowser WebSET 
      Height          =   8895
      Left            =   3480
      TabIndex        =   4
      Top             =   600
      Width           =   11175
      ExtentX         =   19711
      ExtentY         =   15690
      ViewMode        =   0
      Offline         =   0
      Silent          =   0
      RegisterAsBrowser=   0
      RegisterAsDropTarget=   1
      AutoArrange     =   0   'False
      NoClientEdge    =   0   'False
      AlignLeft       =   0   'False
      NoWebView       =   0   'False
      HideFileNames   =   0   'False
      SingleClick     =   0   'False
      SingleSelection =   0   'False
      NoFolders       =   0   'False
      Transparent     =   0   'False
      ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
      Location        =   "http:///"
   End
   Begin VB.ListBox List_NAME 
      Height          =   8880
      Left            =   1800
      TabIndex        =   3
      Top             =   600
      Width           =   1575
   End
   Begin VB.CommandButton Command_clear 
      Caption         =   "清除"
      Height          =   375
      Left            =   2160
      TabIndex        =   2
      Top             =   120
      Width           =   975
   End
   Begin VB.CommandButton Command_found 
      Caption         =   "查找"
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   120
      Width           =   975
   End
   Begin VB.ListBox List_IP 
      Height          =   8880
      Left            =   120
      TabIndex        =   0
      ToolTipText     =   "双击IP打开设置网页"
      Top             =   600
      Width           =   1695
   End
   Begin MSWinsockLib.Winsock TCP_FOUND 
      Left            =   1440
      Top             =   120
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.Label Label1 
      Caption         =   "URL:"
      Height          =   255
      Left            =   3600
      TabIndex        =   7
      Top             =   120
      Width           =   615
   End
   Begin VB.Menu main101 
      Caption         =   "文件"
      Index           =   101
      Begin VB.Menu main102 
         Caption         =   "查找"
         Index           =   102
      End
      Begin VB.Menu main103 
         Caption         =   "清除"
         Index           =   103
      End
      Begin VB.Menu main104 
         Caption         =   "设置"
         Index           =   104
      End
      Begin VB.Menu main105 
         Caption         =   "关闭"
         Index           =   105
      End
   End
   Begin VB.Menu help201 
      Caption         =   "帮助"
      Index           =   201
      Begin VB.Menu help202 
         Caption         =   "版本"
         Index           =   202
      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 Command_clear_Click()
  List_IP.Clear
  List_NAME.Clear
  Shell ("arp -d"), 0
End Sub

Private Sub Command_found_Click()
   TCP_FOUND.Close
   TCP_FOUND.Protocol = sckUDPProtocol
   TCP_FOUND.RemoteHost = "255.255.255.255"
   TCP_FOUND.RemotePort = "4095"
   TCP_FOUND.Bind
   TCP_FOUND.SendData "found000000000000000"
End Sub

Private Sub Command_Openurl_Click()
  
   WebSET.Navigate Text_ip.Text
  
End Sub

Private Sub file001_Click()

End Sub

Private Sub Form_Load()
   Dim s As String
   Command_clear_Click
   WebSET.Navigate "about:blank"
   's = "<p align=center>欢迎使用ECOM系列多串口服务器 </p><p> 提供1、2、4 串口的服务器,支持RS232、RS485、RS422接口。</p><p>技术支持电话 0755-83056708 </p> <p> 公司网址: <a href=http://www.w-smarter.com>http://www.w-smarter.com</a></p>"
   'WebSET.Document.Write s
   
End Sub

Private Sub help202_Click(Index As Integer)

  MsgBox "ECOM-6132*系列串口服务器参数配置程序 VER 3.01", , " "

End Sub

Private Sub List_IP_Click()

  If List_IP.ListIndex <> -1 Then
    List_NAME.ListIndex = List_IP.ListIndex
  End If

End Sub

Private Sub List_IP_DblClick()

  If List_IP.ListIndex <> -1 Then
  WebSET.Navigate "http://" & List_IP.List(List_IP.ListIndex)
  End If

End Sub

Private Sub List_NAME_Click()
  If List_NAME.ListIndex <> -1 Then
    List_IP.ListIndex = List_NAME.ListIndex
  End If
End Sub

Private Sub List_NAME_DblClick()
  Call List_NAME_Click
  If List_NAME.ListIndex <> -1 Then
  WebSET.Navigate "http://" & List_IP.List(List_IP.ListIndex)
  End If
End Sub

Private Sub main102_Click(Index As Integer)

  Command_found_Click

End Sub

Private Sub main103_Click(Index As Integer)
  Command_clear_Click
End Sub

Private Sub main104_Click(Index As Integer)
  
  List_IP_DblClick
  
End Sub

Private Sub main105_Click(Index As Integer)

Unload Me

End Sub

Private Sub TCP_FOUND_DataArrival(ByVal bytesTotal As Long)
   Dim strdata() As Byte
   Dim namedata(10) As Byte
   Dim i  As Integer
   ReDim strdata(bytesTotal) As Byte
   TCP_FOUND.GetData strdata, vbByte, bytesTotal
   If strdata(0) = AscB("f") And strdata(1) = AscB("o") And strdata(2) = AscB("u") And strdata(3) = AscB("n") And strdata(4) = AscB("d") Then
           List_IP.AddItem strdata(6) & "." & strdata(7) & "." & strdata(8) & "." & strdata(9)
           For i = 0 To 9
                  namedata(i) = strdata(10 + i)
           Next i
           List_NAME.AddItem StrConv(namedata, vbUnicode)
   End If
   
End Sub

Private Sub WebSET_DocumentComplete(ByVal pDisp As Object, URL As Variant)

  Text_ip.Text = URL

End Sub

⌨️ 快捷键说明

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