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

📄 frmdatacollect1.vb

📁 这是一个用VB编写的数据采集源码程序.主要是对TPC/IP设备的数据进行采集的文件.
💻 VB
📖 第 1 页 / 共 3 页
字号:
        Me.GridView1.Appearance.OddRow.BackColor = System.Drawing.Color.FromArgb(CType(242, Byte), CType(244, Byte), CType(236, Byte))
        Me.GridView1.Appearance.OddRow.BorderColor = System.Drawing.Color.FromArgb(CType(242, Byte), CType(244, Byte), CType(236, Byte))
        Me.GridView1.Appearance.OddRow.ForeColor = System.Drawing.Color.Black
        Me.GridView1.Appearance.OddRow.Options.UseBackColor = True
        Me.GridView1.Appearance.OddRow.Options.UseBorderColor = True
        Me.GridView1.Appearance.OddRow.Options.UseForeColor = True
        Me.GridView1.Appearance.Preview.BackColor = System.Drawing.Color.FromArgb(CType(250, Byte), CType(250, Byte), CType(240, Byte))
        Me.GridView1.Appearance.Preview.Font = New System.Drawing.Font("Verdana", 7.5!)
        Me.GridView1.Appearance.Preview.ForeColor = System.Drawing.Color.FromArgb(CType(104, Byte), CType(130, Byte), CType(134, Byte))
        Me.GridView1.Appearance.Preview.Options.UseBackColor = True
        Me.GridView1.Appearance.Preview.Options.UseFont = True
        Me.GridView1.Appearance.Preview.Options.UseForeColor = True
        Me.GridView1.Appearance.Row.BackColor = System.Drawing.Color.FromArgb(CType(242, Byte), CType(244, Byte), CType(236, Byte))
        Me.GridView1.Appearance.Row.ForeColor = System.Drawing.Color.Black
        Me.GridView1.Appearance.Row.Options.UseBackColor = True
        Me.GridView1.Appearance.Row.Options.UseForeColor = True
        Me.GridView1.Appearance.RowSeparator.BackColor = System.Drawing.Color.FromArgb(CType(242, Byte), CType(244, Byte), CType(236, Byte))
        Me.GridView1.Appearance.RowSeparator.BackColor2 = System.Drawing.Color.White
        Me.GridView1.Appearance.RowSeparator.Options.UseBackColor = True
        Me.GridView1.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(CType(159, Byte), CType(201, Byte), CType(207, Byte))
        Me.GridView1.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black
        Me.GridView1.Appearance.SelectedRow.Options.UseBackColor = True
        Me.GridView1.Appearance.SelectedRow.Options.UseForeColor = True
        Me.GridView1.Appearance.TopNewRow.BackColor = System.Drawing.Color.White
        Me.GridView1.Appearance.TopNewRow.Options.UseBackColor = True
        Me.GridView1.Appearance.VertLine.BackColor = System.Drawing.Color.FromArgb(CType(172, Byte), CType(197, Byte), CType(180, Byte))
        Me.GridView1.Appearance.VertLine.BorderColor = System.Drawing.Color.FromArgb(CType(117, Byte), CType(136, Byte), CType(122, Byte))
        Me.GridView1.Appearance.VertLine.Options.UseBackColor = True
        Me.GridView1.Appearance.VertLine.Options.UseBorderColor = True
        Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSTATION_NUM, Me.colWAY, Me.colCURRENT_DATA, Me.colPREVIOUS_DATA, Me.colSET_DATA, Me.colSET_TIME})
        Me.GridView1.GridControl = Me.GridControl1
        Me.GridView1.Name = "GridView1"
        Me.GridView1.OptionsView.EnableAppearanceEvenRow = True
        Me.GridView1.OptionsView.EnableAppearanceOddRow = True
        '
        'colSTATION_NUM
        '
        Me.colSTATION_NUM.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colSTATION_NUM.AppearanceCell.Options.UseFont = True
        Me.colSTATION_NUM.AppearanceCell.Options.UseTextOptions = True
        Me.colSTATION_NUM.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colSTATION_NUM.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colSTATION_NUM.Caption = "站点"
        Me.colSTATION_NUM.FieldName = "STATION_NUM"
        Me.colSTATION_NUM.Name = "colSTATION_NUM"
        Me.colSTATION_NUM.Visible = True
        Me.colSTATION_NUM.VisibleIndex = 0
        Me.colSTATION_NUM.Width = 56
        '
        'colWAY
        '
        Me.colWAY.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colWAY.AppearanceCell.Options.UseFont = True
        Me.colWAY.AppearanceCell.Options.UseTextOptions = True
        Me.colWAY.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colWAY.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colWAY.Caption = " 通道"
        Me.colWAY.FieldName = "WAY"
        Me.colWAY.Name = "colWAY"
        Me.colWAY.Visible = True
        Me.colWAY.VisibleIndex = 1
        Me.colWAY.Width = 60
        '
        'colCURRENT_DATA
        '
        Me.colCURRENT_DATA.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colCURRENT_DATA.AppearanceCell.Options.UseFont = True
        Me.colCURRENT_DATA.AppearanceCell.Options.UseTextOptions = True
        Me.colCURRENT_DATA.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colCURRENT_DATA.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colCURRENT_DATA.Caption = "       本次数据"
        Me.colCURRENT_DATA.FieldName = "CURRENT_DATA"
        Me.colCURRENT_DATA.Name = "colCURRENT_DATA"
        Me.colCURRENT_DATA.Visible = True
        Me.colCURRENT_DATA.VisibleIndex = 2
        Me.colCURRENT_DATA.Width = 107
        '
        'colPREVIOUS_DATA
        '
        Me.colPREVIOUS_DATA.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colPREVIOUS_DATA.AppearanceCell.Options.UseFont = True
        Me.colPREVIOUS_DATA.AppearanceCell.Options.UseTextOptions = True
        Me.colPREVIOUS_DATA.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colPREVIOUS_DATA.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colPREVIOUS_DATA.Caption = "      上次数据"
        Me.colPREVIOUS_DATA.FieldName = "PREVIOUS_DATA"
        Me.colPREVIOUS_DATA.Name = "colPREVIOUS_DATA"
        Me.colPREVIOUS_DATA.Visible = True
        Me.colPREVIOUS_DATA.VisibleIndex = 3
        Me.colPREVIOUS_DATA.Width = 107
        '
        'colSET_DATA
        '
        Me.colSET_DATA.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colSET_DATA.AppearanceCell.Options.UseFont = True
        Me.colSET_DATA.AppearanceCell.Options.UseTextOptions = True
        Me.colSET_DATA.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colSET_DATA.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colSET_DATA.Caption = "      更改数据"
        Me.colSET_DATA.FieldName = "SET_DATA"
        Me.colSET_DATA.Name = "colSET_DATA"
        Me.colSET_DATA.Visible = True
        Me.colSET_DATA.VisibleIndex = 4
        Me.colSET_DATA.Width = 107
        '
        'colSET_TIME
        '
        Me.colSET_TIME.AppearanceCell.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.colSET_TIME.AppearanceCell.Options.UseFont = True
        Me.colSET_TIME.AppearanceCell.Options.UseTextOptions = True
        Me.colSET_TIME.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
        Me.colSET_TIME.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center
        Me.colSET_TIME.Caption = "            更改时间"
        Me.colSET_TIME.FieldName = "SET_TIME"
        Me.colSET_TIME.Name = "colSET_TIME"
        Me.colSET_TIME.Visible = True
        Me.colSET_TIME.VisibleIndex = 5
        Me.colSET_TIME.Width = 157
        '
        'myAdapter
        '
        Me.myAdapter.InsertCommand = Me.OracleInsertCommand1
        Me.myAdapter.SelectCommand = Me.OracleSelectCommand1
        Me.myAdapter.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "DATA_COLLECT", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("STATION_NUM", "STATION_NUM"), New System.Data.Common.DataColumnMapping("WAY", "WAY"), New System.Data.Common.DataColumnMapping("CURRENT_DATA", "CURRENT_DATA"), New System.Data.Common.DataColumnMapping("PREVIOUS_DATA", "PREVIOUS_DATA"), New System.Data.Common.DataColumnMapping("SET_DATA", "SET_DATA"), New System.Data.Common.DataColumnMapping("SET_TIME", "SET_TIME")})})
        '
        'OracleInsertCommand1
        '
        Me.OracleInsertCommand1.CommandText = "INSERT INTO DATA_COLLECT(STATION_NUM, WAY, CURRENT_DATA, PREVIOUS_DATA, SET_DATA," & _
        " SET_TIME) VALUES (:STATION_NUM, :WAY, :CURRENT_DATA, :PREVIOUS_DATA, :SET_DATA," & _
        " :SET_TIME)"
        Me.OracleInsertCommand1.Connection = Me.conn
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":STATION_NUM", System.Data.OracleClient.OracleType.Number, 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(0, Byte), "STATION_NUM", System.Data.DataRowVersion.Current, Nothing))
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":WAY", System.Data.OracleClient.OracleType.Number, 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(0, Byte), "WAY", System.Data.DataRowVersion.Current, Nothing))
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":CURRENT_DATA", System.Data.OracleClient.OracleType.Number, 0, System.Data.ParameterDirection.Input, False, CType(30, Byte), CType(0, Byte), "CURRENT_DATA", System.Data.DataRowVersion.Current, Nothing))
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":PREVIOUS_DATA", System.Data.OracleClient.OracleType.Number, 0, System.Data.ParameterDirection.Input, False, CType(30, Byte), CType(0, Byte), "PREVIOUS_DATA", System.Data.DataRowVersion.Current, Nothing))
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":SET_DATA", System.Data.OracleClient.OracleType.Number, 0, System.Data.ParameterDirection.Input, False, CType(30, Byte), CType(0, Byte), "SET_DATA", System.Data.DataRowVersion.Current, Nothing))
        Me.OracleInsertCommand1.Parameters.Add(New System.Data.OracleClient.OracleParameter(":SET_TIME", System.Data.OracleClient.OracleType.VarChar, 30, "SET_TIME"))
        '
        'conn
        '
        Me.conn.ConnectionString = "user id=count;data source=count;password=count"
        '
        'OracleSelectCommand1
        '
        Me.OracleSelectCommand1.CommandText = "SELECT STATION_NUM, WAY, CURRENT_DATA, PREVIOUS_DATA, SET_DATA, SET_TIME FROM DAT" & _
        "A_COLLECT"
        Me.OracleSelectCommand1.Connection = Me.conn
        '
        'Timer1
        '
        Me.Timer1.Interval = 1000
        '
        'BtnStart
        '
        Me.BtnStart.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.BtnStart.Location = New System.Drawing.Point(536, 616)
        Me.BtnStart.Name = "BtnStart"
        Me.BtnStart.Size = New System.Drawing.Size(88, 40)
        Me.BtnStart.TabIndex = 1
        Me.BtnStart.Text = "开始传输"
        '
        'BtnEnd
        '
        Me.BtnEnd.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.BtnEnd.Location = New System.Drawing.Point(672, 616)
        Me.BtnEnd.Name = "BtnEnd"
        Me.BtnEnd.Size = New System.Drawing.Size(88, 40)
        Me.BtnEnd.TabIndex = 2
        Me.BtnEnd.Text = "结束传输"
        '
        'ComboBox1
        '
        Me.ComboBox1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.ComboBox1.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8", "9"})
        Me.ComboBox1.Location = New System.Drawing.Point(272, 624)
        Me.ComboBox1.Name = "ComboBox1"
        Me.ComboBox1.Size = New System.Drawing.Size(40, 24)
        Me.ComboBox1.TabIndex = 3
        Me.ComboBox1.Text = "1"
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label1.Location = New System.Drawing.Point(208, 624)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 23)
        Me.Label1.TabIndex = 4
        Me.Label1.Text = "站点:"
        '
        'BtnShow
        '
        Me.BtnShow.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.BtnShow.Location = New System.Drawing.Point(360, 616)
        Me.BtnShow.Name = "BtnShow"
        Me.BtnShow.Size = New System.Drawing.Size(80, 40)
        Me.BtnShow.TabIndex = 5
        Me.BtnShow.Text = "显示"
        '
        'FrmDataCollect1
        '

⌨️ 快捷键说明

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