📄 config.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Text;
using System.IO.Ports;
namespace motion
{
/// <summary>
/// Summary description for URLForm.
/// </summary>
public class Config : System.Windows.Forms.Form
{
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private string url;
private string FileName;
private GroupBox groupBox1;
private Label label15;
private TextBox txtTurnOffLight;
private Label label10;
private TextBox txtTurnOnLight;
private Label label7;
private TextBox txtStop;
private TextBox txtBackward;
private TextBox txtRight;
private TextBox txtLeft;
private TextBox txtForward;
private Label label6;
private Label label5;
private Label label4;
private Label label3;
private GroupBox groupBox2;
private Label label11;
private TextBox txtPort;
private Label label2;
private Label label1;
private TextBox ControlURL;
private TextBox VideoURL;
private Label label12;
private TextBox txtSpeaker;
private IContainer components;
[DllImport("kernel32")]
private static extern bool WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, byte[] retVal, int size, string filePath);
private SerialPort comm = new SerialPort();
public Config()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label15 = new System.Windows.Forms.Label();
this.txtTurnOffLight = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtTurnOnLight = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.txtStop = new System.Windows.Forms.TextBox();
this.txtBackward = new System.Windows.Forms.TextBox();
this.txtRight = new System.Windows.Forms.TextBox();
this.txtLeft = new System.Windows.Forms.TextBox();
this.txtForward = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ControlURL = new System.Windows.Forms.TextBox();
this.VideoURL = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtPort = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.txtSpeaker = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.okButton.Location = new System.Drawing.Point(186, 255);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(90, 25);
this.okButton.TabIndex = 2;
this.okButton.Text = "保存";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelButton.Location = new System.Drawing.Point(294, 255);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(90, 25);
this.cancelButton.TabIndex = 3;
this.cancelButton.Text = "取消";
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.txtSpeaker);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.txtTurnOffLight);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.txtTurnOnLight);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.txtStop);
this.groupBox1.Controls.Add(this.txtBackward);
this.groupBox1.Controls.Add(this.txtRight);
this.groupBox1.Controls.Add(this.txtLeft);
this.groupBox1.Controls.Add(this.txtForward);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Location = new System.Drawing.Point(16, 104);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(607, 133);
this.groupBox1.TabIndex = 26;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "指令设置";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(462, 101);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(41, 12);
this.label15.TabIndex = 43;
this.label15.Text = "车灯关";
//
// txtTurnOffLight
//
this.txtTurnOffLight.Location = new System.Drawing.Point(507, 96);
this.txtTurnOffLight.Name = "txtTurnOffLight";
this.txtTurnOffLight.Size = new System.Drawing.Size(93, 21);
this.txtTurnOffLight.TabIndex = 42;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(462, 56);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(41, 12);
this.label10.TabIndex = 41;
this.label10.Text = "车灯开";
//
// txtTurnOnLight
//
this.txtTurnOnLight.Location = new System.Drawing.Point(508, 51);
this.txtTurnOnLight.Name = "txtTurnOnLight";
this.txtTurnOnLight.Size = new System.Drawing.Size(93, 21);
this.txtTurnOnLight.TabIndex = 40;
this.txtTurnOnLight.Text = " ";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(340, 60);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(17, 12);
this.label7.TabIndex = 35;
this.label7.Text = "停";
//
// txtStop
//
this.txtStop.Location = new System.Drawing.Point(363, 53);
this.txtStop.Name = "txtStop";
this.txtStop.Size = new System.Drawing.Size(93, 21);
this.txtStop.TabIndex = 34;
//
// txtBackward
//
this.txtBackward.Location = new System.Drawing.Point(108, 88);
this.txtBackward.Name = "txtBackward";
this.txtBackward.Size = new System.Drawing.Size(93, 21);
this.txtBackward.TabIndex = 33;
//
// txtRight
//
this.txtRight.Location = new System.Drawing.Point(177, 61);
this.txtRight.Name = "txtRight";
this.txtRight.Size = new System.Drawing.Size(93, 21);
this.txtRight.TabIndex = 32;
//
// txtLeft
//
this.txtLeft.Location = new System.Drawing.Point(47, 63);
this.txtLeft.Name = "txtLeft";
this.txtLeft.Size = new System.Drawing.Size(93, 21);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -