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

📄 form1.frm

📁 利用vb的Mscomm控件实现全站仪及GPS的数据通信程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H8000000E&
   Caption         =   "发送数据"
   ClientHeight    =   1320
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3180
   LinkTopic       =   "Form1"
   ScaleHeight     =   1320
   ScaleWidth      =   3180
   StartUpPosition =   3  '窗口缺省
   Begin VB.Label lable1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "GPS数据发送"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   2175
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strINIFileName As String, strSecName As String
Dim strKey As String, strINI(1 To 20) As String
Dim iniI As Integer

Private Sub Form_Load()
strINIFileName = App.Path & "\GPS数据.ini"
strSecName = "虚拟GPS"
strKey = "Key"
strINI(1) = "$GPGGA,162411,3800.1238,N,11700.3859,E,1,06,0.01,5.1,M,-3.2,M,,*63"
strINI(2) = "$GPGGA,162412,3801.1238,N,11701.3859,E,1,06,0.02,5.1,M,-3.2,M,,*63"
strINI(3) = "$GPGGA,162413,3802.1238,N,11700.3859,E,1,06,0.03,5.1,M,-3.2,M,,*63"
strINI(4) = "$GPGGA,162414,3803.1238,N,11700.3859,E,1,06,0.04,5.1,M,-3.2,M,,*63"
strINI(5) = "$GPGGA,162415,3804.1238,N,11700.3859,E,1,06,0.05,5.1,M,-3.2,M,,*63"
strINI(6) = "$GPGGA,162416,3805.1238,N,11700.3859,E,1,06,0.06,5.1,M,-3.2,M,,*63"
strINI(7) = "$GPGGA,162417,3806.1238,N,11700.3859,E,1,06,0.07,5.1,M,-3.2,M,,*63"
strINI(8) = "$GPGGA,162418,3807.1238,N,11700.3859,E,1,06,0.08,5.1,M,-3.2,M,,*63"
strINI(9) = "$GPGGA,162419,3808.1238,N,11700.3859,E,1,06,0.09,5.1,M,-3.2,M,,*63"
strINI(10) = "$GPGGA,162420,3809.1238,N,11700.3859,E,1,06,0.10,5.1,M,-3.2,M,,*63"
strINI(11) = "$GPGGA,162421,3810.1238,N,11700.3859,E,1,06,0.11,5.1,M,-3.2,M,,*63"
strINI(12) = "$GPGGA,162422,3811.1238,N,11700.3859,E,1,06,0.12,5.1,M,-3.2,M,,*63"
strINI(13) = "$GPGGA,162423,3812.1238,N,11700.3859,E,1,06,0.13,5.1,M,-3.2,M,,*63"
strINI(14) = "$GPGGA,162424,3813.1238,N,11700.3859,E,1,06,0.14,5.1,M,-3.2,M,,*63"
strINI(15) = "$GPGGA,162425,3814.1238,N,11700.3859,E,1,06,0.15,5.1,M,-3.2,M,,*63"
strINI(16) = "$GPGGA,162426,3815.1238,N,11700.3859,E,1,06,0.16,5.1,M,-3.2,M,,*63"
strINI(17) = "$GPGGA,162428,3816.1238,N,11700.3859,E,1,06,0.17,5.1,M,-3.2,M,,*63"
strINI(18) = "$GPGGA,162429,3817.1238,N,11700.3859,E,1,06,0.18,5.1,M,-3.2,M,,*63"
strINI(19) = "$GPGGA,162430,3818.1238,N,11700.3859,E,1,06,0.19,5.1,M,-3.2,M,,*63"
strINI(20) = "$GPGGA,162431,3819.1238,N,11700.3859,E,1,06,0.20,5.1,M,-3.2,M,,*63"

For iniI = 1 To 20
     WritePrivateProfileString strSecName, strKey & iniI, strINI(iniI), strINIFileName
Next iniI
     
     

End Sub

⌨️ 快捷键说明

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