starting work on JSON
This commit is contained in:
398
Form1.Designer.cs
generated
398
Form1.Designer.cs
generated
@@ -29,20 +29,29 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(App));
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.GBox_Serial = new System.Windows.Forms.GroupBox();
|
||||
this.panel11 = new System.Windows.Forms.Panel();
|
||||
this.CBox_Parity = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.panel10 = new System.Windows.Forms.Panel();
|
||||
this.CBox_StopBits = new System.Windows.Forms.ComboBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.panel8 = new System.Windows.Forms.Panel();
|
||||
this.panel9 = new System.Windows.Forms.Panel();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.CBox_DataBits = new System.Windows.Forms.ComboBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.panel7 = new System.Windows.Forms.Panel();
|
||||
this.CBox_BaudRate = new System.Windows.Forms.ComboBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.ButtonConnect = new System.Windows.Forms.Button();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.UpDown_ModbusID = new System.Windows.Forms.NumericUpDown();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.CBox_Ports = new System.Windows.Forms.ComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.ButtonConnect = new System.Windows.Forms.Button();
|
||||
this.TextBox_Log = new System.Windows.Forms.TextBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
@@ -58,17 +67,24 @@
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.CBox_Function = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.panel9 = new System.Windows.Forms.Panel();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.panel10 = new System.Windows.Forms.Panel();
|
||||
this.CBox_StopBits = new System.Windows.Forms.ComboBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.panel11 = new System.Windows.Forms.Panel();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.GBox_Ethernet = new System.Windows.Forms.GroupBox();
|
||||
this.panel16 = new System.Windows.Forms.Panel();
|
||||
this.TBox_Port = new System.Windows.Forms.TextBox();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
this.panel17 = new System.Windows.Forms.Panel();
|
||||
this.TBox_Timeout = new System.Windows.Forms.TextBox();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.panel18 = new System.Windows.Forms.Panel();
|
||||
this.TBox_IP = new System.Windows.Forms.TextBox();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.Radio_Ethernet = new System.Windows.Forms.RadioButton();
|
||||
this.Radio_SerialPort = new System.Windows.Forms.RadioButton();
|
||||
this.GBox_Serial.SuspendLayout();
|
||||
this.panel11.SuspendLayout();
|
||||
this.panel10.SuspendLayout();
|
||||
this.panel8.SuspendLayout();
|
||||
this.panel9.SuspendLayout();
|
||||
this.panel7.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.UpDown_ModbusID)).BeginInit();
|
||||
@@ -81,26 +97,81 @@
|
||||
this.panel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.UpDown_RegAddress)).BeginInit();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel9.SuspendLayout();
|
||||
this.panel10.SuspendLayout();
|
||||
this.panel11.SuspendLayout();
|
||||
this.GBox_Ethernet.SuspendLayout();
|
||||
this.panel16.SuspendLayout();
|
||||
this.panel17.SuspendLayout();
|
||||
this.panel18.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
// GBox_Serial
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.panel11);
|
||||
this.groupBox1.Controls.Add(this.panel10);
|
||||
this.groupBox1.Controls.Add(this.panel8);
|
||||
this.groupBox1.Controls.Add(this.panel7);
|
||||
this.groupBox1.Controls.Add(this.ButtonConnect);
|
||||
this.groupBox1.Controls.Add(this.panel2);
|
||||
this.groupBox1.Controls.Add(this.panel1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(490, 110);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Подключение";
|
||||
this.GBox_Serial.Controls.Add(this.panel11);
|
||||
this.GBox_Serial.Controls.Add(this.panel10);
|
||||
this.GBox_Serial.Controls.Add(this.panel8);
|
||||
this.GBox_Serial.Controls.Add(this.panel7);
|
||||
this.GBox_Serial.Controls.Add(this.panel2);
|
||||
this.GBox_Serial.Controls.Add(this.panel1);
|
||||
this.GBox_Serial.Location = new System.Drawing.Point(12, 12);
|
||||
this.GBox_Serial.Name = "GBox_Serial";
|
||||
this.GBox_Serial.Size = new System.Drawing.Size(490, 65);
|
||||
this.GBox_Serial.TabIndex = 0;
|
||||
this.GBox_Serial.TabStop = false;
|
||||
this.GBox_Serial.Text = "Серийный порт";
|
||||
//
|
||||
// panel11
|
||||
//
|
||||
this.panel11.Controls.Add(this.CBox_Parity);
|
||||
this.panel11.Controls.Add(this.label11);
|
||||
this.panel11.Location = new System.Drawing.Point(330, 19);
|
||||
this.panel11.Name = "panel11";
|
||||
this.panel11.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel11.TabIndex = 6;
|
||||
//
|
||||
// CBox_Parity
|
||||
//
|
||||
this.CBox_Parity.FormattingEnabled = true;
|
||||
this.CBox_Parity.Location = new System.Drawing.Point(6, 17);
|
||||
this.CBox_Parity.Name = "CBox_Parity";
|
||||
this.CBox_Parity.Size = new System.Drawing.Size(70, 21);
|
||||
this.CBox_Parity.TabIndex = 2;
|
||||
this.CBox_Parity.Text = "8";
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(3, 0);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(103, 13);
|
||||
this.label11.TabIndex = 0;
|
||||
this.label11.Text = "Контроль четности";
|
||||
//
|
||||
// panel10
|
||||
//
|
||||
this.panel10.Controls.Add(this.CBox_StopBits);
|
||||
this.panel10.Controls.Add(this.label10);
|
||||
this.panel10.Location = new System.Drawing.Point(247, 19);
|
||||
this.panel10.Name = "panel10";
|
||||
this.panel10.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel10.TabIndex = 5;
|
||||
//
|
||||
// CBox_StopBits
|
||||
//
|
||||
this.CBox_StopBits.FormattingEnabled = true;
|
||||
this.CBox_StopBits.Location = new System.Drawing.Point(6, 17);
|
||||
this.CBox_StopBits.Name = "CBox_StopBits";
|
||||
this.CBox_StopBits.Size = new System.Drawing.Size(70, 21);
|
||||
this.CBox_StopBits.TabIndex = 2;
|
||||
this.CBox_StopBits.Text = "8";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(3, 0);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(59, 13);
|
||||
this.label10.TabIndex = 0;
|
||||
this.label10.Text = "Стоп-биты";
|
||||
//
|
||||
// panel8
|
||||
//
|
||||
@@ -112,6 +183,33 @@
|
||||
this.panel8.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel8.TabIndex = 4;
|
||||
//
|
||||
// panel9
|
||||
//
|
||||
this.panel9.Controls.Add(this.comboBox1);
|
||||
this.panel9.Controls.Add(this.label9);
|
||||
this.panel9.Location = new System.Drawing.Point(82, 0);
|
||||
this.panel9.Name = "panel9";
|
||||
this.panel9.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel9.TabIndex = 5;
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(6, 17);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(70, 21);
|
||||
this.comboBox1.TabIndex = 2;
|
||||
this.comboBox1.Text = "8";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(3, 0);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(73, 13);
|
||||
this.label9.TabIndex = 0;
|
||||
this.label9.Text = "Биты данных";
|
||||
//
|
||||
// CBox_DataBits
|
||||
//
|
||||
this.CBox_DataBits.FormattingEnabled = true;
|
||||
@@ -157,18 +255,6 @@
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "Боды";
|
||||
//
|
||||
// ButtonConnect
|
||||
//
|
||||
this.ButtonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ButtonConnect.Location = new System.Drawing.Point(195, 75);
|
||||
this.ButtonConnect.Name = "ButtonConnect";
|
||||
this.ButtonConnect.Size = new System.Drawing.Size(100, 25);
|
||||
this.ButtonConnect.TabIndex = 4;
|
||||
this.ButtonConnect.Text = "Подключиться";
|
||||
this.ButtonConnect.UseVisualStyleBackColor = true;
|
||||
this.ButtonConnect.Click += new System.EventHandler(this.ButtonConnect_Click);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.UpDown_ModbusID);
|
||||
@@ -222,9 +308,21 @@
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Порт";
|
||||
//
|
||||
// ButtonConnect
|
||||
//
|
||||
this.ButtonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ButtonConnect.Location = new System.Drawing.Point(203, 155);
|
||||
this.ButtonConnect.Name = "ButtonConnect";
|
||||
this.ButtonConnect.Size = new System.Drawing.Size(100, 25);
|
||||
this.ButtonConnect.TabIndex = 4;
|
||||
this.ButtonConnect.Text = "Подключиться";
|
||||
this.ButtonConnect.UseVisualStyleBackColor = true;
|
||||
this.ButtonConnect.Click += new System.EventHandler(this.ButtonConnect_Click);
|
||||
//
|
||||
// TextBox_Log
|
||||
//
|
||||
this.TextBox_Log.Location = new System.Drawing.Point(12, 127);
|
||||
this.TextBox_Log.Location = new System.Drawing.Point(12, 192);
|
||||
this.TextBox_Log.Multiline = true;
|
||||
this.TextBox_Log.Name = "TextBox_Log";
|
||||
this.TextBox_Log.ReadOnly = true;
|
||||
@@ -239,7 +337,7 @@
|
||||
this.groupBox2.Controls.Add(this.Button_SendCommand);
|
||||
this.groupBox2.Controls.Add(this.panel3);
|
||||
this.groupBox2.Controls.Add(this.panel4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 251);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 316);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(490, 63);
|
||||
this.groupBox2.TabIndex = 5;
|
||||
@@ -359,104 +457,154 @@
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Функция";
|
||||
//
|
||||
// panel9
|
||||
// GBox_Ethernet
|
||||
//
|
||||
this.panel9.Controls.Add(this.comboBox1);
|
||||
this.panel9.Controls.Add(this.label9);
|
||||
this.panel9.Location = new System.Drawing.Point(82, 0);
|
||||
this.panel9.Name = "panel9";
|
||||
this.panel9.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel9.TabIndex = 5;
|
||||
this.GBox_Ethernet.Controls.Add(this.panel16);
|
||||
this.GBox_Ethernet.Controls.Add(this.panel17);
|
||||
this.GBox_Ethernet.Controls.Add(this.panel18);
|
||||
this.GBox_Ethernet.Location = new System.Drawing.Point(12, 82);
|
||||
this.GBox_Ethernet.Name = "GBox_Ethernet";
|
||||
this.GBox_Ethernet.Size = new System.Drawing.Size(334, 65);
|
||||
this.GBox_Ethernet.TabIndex = 6;
|
||||
this.GBox_Ethernet.TabStop = false;
|
||||
this.GBox_Ethernet.Text = "Ethernet";
|
||||
//
|
||||
// comboBox1
|
||||
// panel16
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(6, 17);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(70, 21);
|
||||
this.comboBox1.TabIndex = 2;
|
||||
this.comboBox1.Text = "8";
|
||||
this.panel16.Controls.Add(this.TBox_Port);
|
||||
this.panel16.Controls.Add(this.label16);
|
||||
this.panel16.Location = new System.Drawing.Point(175, 19);
|
||||
this.panel16.Name = "panel16";
|
||||
this.panel16.Size = new System.Drawing.Size(75, 43);
|
||||
this.panel16.TabIndex = 3;
|
||||
//
|
||||
// label9
|
||||
// TBox_Port
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(3, 0);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(73, 13);
|
||||
this.label9.TabIndex = 0;
|
||||
this.label9.Text = "Биты данных";
|
||||
this.TBox_Port.Location = new System.Drawing.Point(6, 17);
|
||||
this.TBox_Port.Name = "TBox_Port";
|
||||
this.TBox_Port.Size = new System.Drawing.Size(66, 20);
|
||||
this.TBox_Port.TabIndex = 1;
|
||||
//
|
||||
// panel10
|
||||
// label16
|
||||
//
|
||||
this.panel10.Controls.Add(this.CBox_StopBits);
|
||||
this.panel10.Controls.Add(this.label10);
|
||||
this.panel10.Location = new System.Drawing.Point(247, 19);
|
||||
this.panel10.Name = "panel10";
|
||||
this.panel10.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel10.TabIndex = 5;
|
||||
this.label16.AutoSize = true;
|
||||
this.label16.Location = new System.Drawing.Point(3, 0);
|
||||
this.label16.Name = "label16";
|
||||
this.label16.Size = new System.Drawing.Size(32, 13);
|
||||
this.label16.TabIndex = 0;
|
||||
this.label16.Text = "Порт";
|
||||
//
|
||||
// CBox_StopBits
|
||||
// panel17
|
||||
//
|
||||
this.CBox_StopBits.FormattingEnabled = true;
|
||||
this.CBox_StopBits.Location = new System.Drawing.Point(6, 17);
|
||||
this.CBox_StopBits.Name = "CBox_StopBits";
|
||||
this.CBox_StopBits.Size = new System.Drawing.Size(70, 21);
|
||||
this.CBox_StopBits.TabIndex = 2;
|
||||
this.CBox_StopBits.Text = "8";
|
||||
this.panel17.Controls.Add(this.TBox_Timeout);
|
||||
this.panel17.Controls.Add(this.label17);
|
||||
this.panel17.Location = new System.Drawing.Point(253, 19);
|
||||
this.panel17.Name = "panel17";
|
||||
this.panel17.Size = new System.Drawing.Size(75, 43);
|
||||
this.panel17.TabIndex = 2;
|
||||
//
|
||||
// label10
|
||||
// TBox_Timeout
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(3, 0);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(59, 13);
|
||||
this.label10.TabIndex = 0;
|
||||
this.label10.Text = "Стоп-биты";
|
||||
this.TBox_Timeout.Location = new System.Drawing.Point(6, 17);
|
||||
this.TBox_Timeout.Name = "TBox_Timeout";
|
||||
this.TBox_Timeout.Size = new System.Drawing.Size(66, 20);
|
||||
this.TBox_Timeout.TabIndex = 2;
|
||||
//
|
||||
// panel11
|
||||
// label17
|
||||
//
|
||||
this.panel11.Controls.Add(this.comboBox2);
|
||||
this.panel11.Controls.Add(this.label11);
|
||||
this.panel11.Location = new System.Drawing.Point(330, 19);
|
||||
this.panel11.Name = "panel11";
|
||||
this.panel11.Size = new System.Drawing.Size(79, 43);
|
||||
this.panel11.TabIndex = 6;
|
||||
this.label17.AutoSize = true;
|
||||
this.label17.Location = new System.Drawing.Point(3, 0);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(74, 13);
|
||||
this.label17.TabIndex = 0;
|
||||
this.label17.Text = "Таймаут, сек";
|
||||
//
|
||||
// comboBox2
|
||||
// panel18
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(6, 17);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(70, 21);
|
||||
this.comboBox2.TabIndex = 2;
|
||||
this.comboBox2.Text = "8";
|
||||
this.panel18.Controls.Add(this.TBox_IP);
|
||||
this.panel18.Controls.Add(this.label18);
|
||||
this.panel18.Location = new System.Drawing.Point(0, 19);
|
||||
this.panel18.Name = "panel18";
|
||||
this.panel18.Size = new System.Drawing.Size(172, 43);
|
||||
this.panel18.TabIndex = 0;
|
||||
//
|
||||
// label11
|
||||
// TBox_IP
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(3, 0);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(59, 13);
|
||||
this.label11.TabIndex = 0;
|
||||
this.label11.Text = "Стоп-биты";
|
||||
this.TBox_IP.Location = new System.Drawing.Point(6, 17);
|
||||
this.TBox_IP.Name = "TBox_IP";
|
||||
this.TBox_IP.Size = new System.Drawing.Size(163, 20);
|
||||
this.TBox_IP.TabIndex = 1;
|
||||
//
|
||||
// label18
|
||||
//
|
||||
this.label18.AutoSize = true;
|
||||
this.label18.Location = new System.Drawing.Point(3, 0);
|
||||
this.label18.Name = "label18";
|
||||
this.label18.Size = new System.Drawing.Size(50, 13);
|
||||
this.label18.TabIndex = 0;
|
||||
this.label18.Text = "IP адрес";
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.Radio_Ethernet);
|
||||
this.groupBox4.Controls.Add(this.Radio_SerialPort);
|
||||
this.groupBox4.Location = new System.Drawing.Point(348, 82);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(154, 65);
|
||||
this.groupBox4.TabIndex = 7;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Режим";
|
||||
//
|
||||
// Radio_Ethernet
|
||||
//
|
||||
this.Radio_Ethernet.AutoSize = true;
|
||||
this.Radio_Ethernet.Location = new System.Drawing.Point(7, 37);
|
||||
this.Radio_Ethernet.Name = "Radio_Ethernet";
|
||||
this.Radio_Ethernet.Size = new System.Drawing.Size(65, 17);
|
||||
this.Radio_Ethernet.TabIndex = 1;
|
||||
this.Radio_Ethernet.TabStop = true;
|
||||
this.Radio_Ethernet.Text = "Ethernet";
|
||||
this.Radio_Ethernet.UseVisualStyleBackColor = true;
|
||||
this.Radio_Ethernet.CheckedChanged += new System.EventHandler(this.Radio_Ethernet_CheckedChanged);
|
||||
//
|
||||
// Radio_SerialPort
|
||||
//
|
||||
this.Radio_SerialPort.AutoSize = true;
|
||||
this.Radio_SerialPort.Location = new System.Drawing.Point(7, 20);
|
||||
this.Radio_SerialPort.Name = "Radio_SerialPort";
|
||||
this.Radio_SerialPort.Size = new System.Drawing.Size(102, 17);
|
||||
this.Radio_SerialPort.TabIndex = 0;
|
||||
this.Radio_SerialPort.TabStop = true;
|
||||
this.Radio_SerialPort.Text = "Серийный порт";
|
||||
this.Radio_SerialPort.UseVisualStyleBackColor = true;
|
||||
this.Radio_SerialPort.CheckedChanged += new System.EventHandler(this.Radio_SerialPort_CheckedChanged);
|
||||
//
|
||||
// App
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(514, 326);
|
||||
this.ClientSize = new System.Drawing.Size(514, 391);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.GBox_Ethernet);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.TextBox_Log);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.GBox_Serial);
|
||||
this.Controls.Add(this.ButtonConnect);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "App";
|
||||
this.Text = "Gidrolock Modbus Scanner";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.App_FormClosed);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.GBox_Serial.ResumeLayout(false);
|
||||
this.panel11.ResumeLayout(false);
|
||||
this.panel11.PerformLayout();
|
||||
this.panel10.ResumeLayout(false);
|
||||
this.panel10.PerformLayout();
|
||||
this.panel8.ResumeLayout(false);
|
||||
this.panel8.PerformLayout();
|
||||
this.panel9.ResumeLayout(false);
|
||||
this.panel9.PerformLayout();
|
||||
this.panel7.ResumeLayout(false);
|
||||
this.panel7.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
@@ -476,12 +624,15 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.UpDown_RegAddress)).EndInit();
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel4.PerformLayout();
|
||||
this.panel9.ResumeLayout(false);
|
||||
this.panel9.PerformLayout();
|
||||
this.panel10.ResumeLayout(false);
|
||||
this.panel10.PerformLayout();
|
||||
this.panel11.ResumeLayout(false);
|
||||
this.panel11.PerformLayout();
|
||||
this.GBox_Ethernet.ResumeLayout(false);
|
||||
this.panel16.ResumeLayout(false);
|
||||
this.panel16.PerformLayout();
|
||||
this.panel17.ResumeLayout(false);
|
||||
this.panel17.PerformLayout();
|
||||
this.panel18.ResumeLayout(false);
|
||||
this.panel18.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -489,7 +640,7 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox GBox_Serial;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.NumericUpDown UpDown_ModbusID;
|
||||
private System.Windows.Forms.Label label2;
|
||||
@@ -525,8 +676,21 @@
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Panel panel11;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox CBox_Parity;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.GroupBox GBox_Ethernet;
|
||||
private System.Windows.Forms.Panel panel16;
|
||||
private System.Windows.Forms.Label label16;
|
||||
private System.Windows.Forms.Panel panel17;
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.Panel panel18;
|
||||
private System.Windows.Forms.Label label18;
|
||||
private System.Windows.Forms.TextBox TBox_Port;
|
||||
private System.Windows.Forms.TextBox TBox_Timeout;
|
||||
private System.Windows.Forms.TextBox TBox_IP;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.RadioButton Radio_Ethernet;
|
||||
private System.Windows.Forms.RadioButton Radio_SerialPort;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
91
Form1.cs
91
Form1.cs
@@ -14,6 +14,8 @@ using System.Runtime;
|
||||
using System.Web;
|
||||
using System.Windows.Forms.Automation;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace Gidrolock_Modbus_Scanner
|
||||
{
|
||||
@@ -24,7 +26,7 @@ namespace Gidrolock_Modbus_Scanner
|
||||
110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 76800, 115200, 230300, 460800, 921600
|
||||
};
|
||||
public static int[] DataBits = new int[] { 7, 8 };
|
||||
|
||||
Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
|
||||
int offset = 0;
|
||||
byte[] message = new byte[255];
|
||||
public bool isAwaitingResponse = false;
|
||||
@@ -46,7 +48,7 @@ namespace Gidrolock_Modbus_Scanner
|
||||
CBox_Function.Items.Add("03 - Read Holding Register");
|
||||
CBox_Function.Items.Add("04 - Read Input Register");
|
||||
CBox_Function.Items.Add("05 - Write Single Coil");
|
||||
CBox_Function.Items.Add("06 - Write Single Holding Register");
|
||||
CBox_Function.Items.Add("06 - Write Single Register");
|
||||
CBox_Function.Items.Add("0F - Write Multiple Coils");
|
||||
CBox_Function.Items.Add("10 - Write Multiple Registers");
|
||||
CBox_Function.SelectedItem = CBox_Function.Items[0];
|
||||
@@ -79,11 +81,23 @@ namespace Gidrolock_Modbus_Scanner
|
||||
CBox_StopBits.Items.Add("2");
|
||||
CBox_StopBits.SelectedIndex = 1;
|
||||
|
||||
CBox_Parity.Items.Add("Нет");
|
||||
CBox_Parity.Items.Add("Четн.");
|
||||
CBox_Parity.Items.Add("Нечетн.");
|
||||
CBox_Parity.SelectedIndex = 0;
|
||||
|
||||
|
||||
UpDown_RegAddress.Minimum = 0;
|
||||
UpDown_RegAddress.Maximum = 65535;
|
||||
|
||||
UpDown_Value.Minimum = 0;
|
||||
UpDown_Value.Maximum = 65535; // 2^16
|
||||
|
||||
Radio_SerialPort.Checked = true;
|
||||
GBox_Ethernet.Enabled = false;
|
||||
TBox_IP.Text = "192.168.3.7";
|
||||
TBox_Port.Text = "8887";
|
||||
TBox_Timeout.Text = "3";
|
||||
}
|
||||
void App_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
@@ -192,7 +206,37 @@ namespace Gidrolock_Modbus_Scanner
|
||||
private async void ButtonConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddLog("Попытка подключиться к устройству Gidrolock.");
|
||||
await SendMessageAsync(FunctionCode.DiscreteInput, 200, 5);
|
||||
|
||||
if (Radio_SerialPort.Checked)
|
||||
await SendMessageAsync(FunctionCode.InputRegister, 200, 6);
|
||||
//else EthernetParse();
|
||||
}
|
||||
|
||||
async void EthernetParse()
|
||||
{
|
||||
string ipText = TBox_IP.Text;
|
||||
string portText = TBox_Port.Text;
|
||||
|
||||
Regex ip = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
|
||||
Regex port = new Regex(@"\d");
|
||||
|
||||
if (!ip.IsMatch(ipText))
|
||||
MessageBox.Show("Неправильный формат IP-адреса.");
|
||||
else if (!port.IsMatch(portText))
|
||||
MessageBox.Show("Неправильный формат TCP-порта.");
|
||||
else
|
||||
{
|
||||
int portParsed = Int32.Parse(portText);
|
||||
await socket.ConnectAsync(ipText, portParsed);
|
||||
byte[] data = new byte[8];
|
||||
Modbus.BuildMessage(0x1E, 0x03, 128, 1, ref data);
|
||||
AddLog("Sending to " + ipText + ":" + portText + ":" + Modbus.ParseByteArray(data));
|
||||
|
||||
// set up an event listener to receive the response
|
||||
await SocketDataTransfer(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CBox_Ports_Click(object sender, EventArgs e)
|
||||
@@ -212,7 +256,7 @@ namespace Gidrolock_Modbus_Scanner
|
||||
try
|
||||
{
|
||||
port.Read(message, 0, 3);
|
||||
int length = (int)message[2];
|
||||
int length = (int)message[2];
|
||||
for (int i = 0; i < length + 2; i++)
|
||||
{
|
||||
port.Read(message, i + 3, 1);
|
||||
@@ -234,8 +278,10 @@ namespace Gidrolock_Modbus_Scanner
|
||||
catch (Exception err)
|
||||
{
|
||||
MessageBox.Show(err.Message);
|
||||
isProcessingResponse = false;
|
||||
}
|
||||
}
|
||||
else Console.WriteLine("Already processing incoming message!");
|
||||
|
||||
//port.Close();
|
||||
|
||||
@@ -268,6 +314,43 @@ namespace Gidrolock_Modbus_Scanner
|
||||
UpDown_Value.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void Radio_SerialPort_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Radio_SerialPort.Checked)
|
||||
GBox_Serial.Enabled = true;
|
||||
else GBox_Serial.Enabled = false;
|
||||
}
|
||||
|
||||
private void Radio_Ethernet_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Radio_Ethernet.Checked)
|
||||
GBox_Ethernet.Enabled = true;
|
||||
else GBox_Ethernet.Enabled = false;
|
||||
}
|
||||
|
||||
private async Task<bool> SocketDataTransfer(byte[] data)
|
||||
{
|
||||
await Task.Run(() => { socket.Send(data); });
|
||||
byte[] res = new byte[64];
|
||||
await Task.Run(() =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
int bytesReceived = socket.Receive(res);
|
||||
|
||||
if (bytesReceived == 0)
|
||||
break;
|
||||
|
||||
string resParsed = "";
|
||||
Modbus.ParseResponse(res, ref resParsed);
|
||||
|
||||
Console.Out.WriteLine("Received data on TCP socket: " + resParsed);
|
||||
AddLog("Response from TCP Server: " + resParsed);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -24,7 +25,6 @@
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
@@ -32,11 +32,12 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -47,7 +48,13 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Gidrolock Logo.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -61,6 +68,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="JSONParser.cs" />
|
||||
<Compile Include="Modbus.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -84,6 +92,7 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include=".gitignore" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -110,5 +119,8 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Gidrolock Logo.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<PublishUrlHistory />
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
|
||||
26
JSONParser.cs
Normal file
26
JSONParser.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Gidrolock_Modbus_Scanner
|
||||
{
|
||||
public struct Entry
|
||||
{
|
||||
public string label;
|
||||
public RegisterType registerType;
|
||||
public int offset;
|
||||
public int length;
|
||||
|
||||
public Entry(string label, RegisterType registerType, int offset, int length)
|
||||
{
|
||||
this.label = label;
|
||||
this.registerType = registerType;
|
||||
this.offset = offset;
|
||||
this.length = length;
|
||||
}
|
||||
}
|
||||
public enum RegisterType { Coil, DiscreteInput, HoldingRegister, InputRegister }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -6,9 +7,9 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Gidrolock Modbus Scanner")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("A collection of Modbus tools.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("Gidroresurs LLC")]
|
||||
[assembly: AssemblyProduct("Gidrolock Modbus Scanner")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
@@ -29,5 +30,6 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("0.0.0.3")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.3")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
## To-Do
|
||||
1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> `.json` <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> `.json` <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Modbus TCP
|
||||
4
packages.config
Normal file
4
packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
</packages>
|
||||
BIN
packages/Newtonsoft.Json.13.0.3/.signature.p7s
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/.signature.p7s
vendored
Normal file
Binary file not shown.
20
packages/Newtonsoft.Json.13.0.3/LICENSE.md
vendored
Normal file
20
packages/Newtonsoft.Json.13.0.3/LICENSE.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007 James Newton-King
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
BIN
packages/Newtonsoft.Json.13.0.3/Newtonsoft.Json.13.0.3.nupkg
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/Newtonsoft.Json.13.0.3.nupkg
vendored
Normal file
Binary file not shown.
71
packages/Newtonsoft.Json.13.0.3/README.md
vendored
Normal file
71
packages/Newtonsoft.Json.13.0.3/README.md
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
#  Json.NET
|
||||
|
||||
[](https://www.nuget.org/packages/Newtonsoft.Json/)
|
||||
[](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
|
||||
|
||||
Json.NET is a popular high-performance JSON framework for .NET
|
||||
|
||||
## Serialize JSON
|
||||
|
||||
```csharp
|
||||
Product product = new Product();
|
||||
product.Name = "Apple";
|
||||
product.Expiry = new DateTime(2008, 12, 28);
|
||||
product.Sizes = new string[] { "Small" };
|
||||
|
||||
string json = JsonConvert.SerializeObject(product);
|
||||
// {
|
||||
// "Name": "Apple",
|
||||
// "Expiry": "2008-12-28T00:00:00",
|
||||
// "Sizes": [
|
||||
// "Small"
|
||||
// ]
|
||||
// }
|
||||
```
|
||||
|
||||
## Deserialize JSON
|
||||
|
||||
```csharp
|
||||
string json = @"{
|
||||
'Name': 'Bad Boys',
|
||||
'ReleaseDate': '1995-4-7T00:00:00',
|
||||
'Genres': [
|
||||
'Action',
|
||||
'Comedy'
|
||||
]
|
||||
}";
|
||||
|
||||
Movie m = JsonConvert.DeserializeObject<Movie>(json);
|
||||
|
||||
string name = m.Name;
|
||||
// Bad Boys
|
||||
```
|
||||
|
||||
## LINQ to JSON
|
||||
|
||||
```csharp
|
||||
JArray array = new JArray();
|
||||
array.Add("Manual text");
|
||||
array.Add(new DateTime(2000, 5, 23));
|
||||
|
||||
JObject o = new JObject();
|
||||
o["MyArray"] = array;
|
||||
|
||||
string json = o.ToString();
|
||||
// {
|
||||
// "MyArray": [
|
||||
// "Manual text",
|
||||
// "2000-05-23T00:00:00"
|
||||
// ]
|
||||
// }
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Homepage](https://www.newtonsoft.com/json)
|
||||
- [Documentation](https://www.newtonsoft.com/json/help)
|
||||
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
|
||||
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
|
||||
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
|
||||
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
|
||||
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)
|
||||
BIN
packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
10393
packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.xml
vendored
Normal file
10393
packages/Newtonsoft.Json.13.0.3/lib/net20/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
9541
packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.xml
vendored
Normal file
9541
packages/Newtonsoft.Json.13.0.3/lib/net35/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
9741
packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.xml
vendored
Normal file
9741
packages/Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11363
packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.xml
vendored
Normal file
11363
packages/Newtonsoft.Json.13.0.3/lib/net45/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11325
packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.xml
vendored
Normal file
11325
packages/Newtonsoft.Json.13.0.3/lib/net6.0/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11051
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.xml
vendored
Normal file
11051
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11173
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.xml
vendored
Normal file
11173
packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11338
packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.xml
vendored
Normal file
11338
packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.13.0.3/packageIcon.png
vendored
Normal file
BIN
packages/Newtonsoft.Json.13.0.3/packageIcon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Reference in New Issue
Block a user