v3.8.5.0 1、设置修改实时保存。2、可添加多个公网IP网址,自动运行是逐个查询,当有返回值时停止。3、简化代码。
This commit is contained in:
parent
f4f5d6258b
commit
e49aab84c7
@ -103,16 +103,16 @@ namespace net.nutcore.aliddns
|
||||
new XElement("add", new XAttribute("key", "AccessKeyID"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "AccessKeySecret"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "RecordID"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "fullDomainName"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "WaitingTime"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "autoUpdate"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "whatIsUrl"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "autoBoot"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "minimized"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "logautosave"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "TTL"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "autoCheckUpdate"), new XAttribute("value", "")),
|
||||
new XElement("add", new XAttribute("key", "ngrokauto"), new XAttribute("value", ""))
|
||||
new XElement("add", new XAttribute("key", "fullDomainName"), new XAttribute("value", "www.xxx.com")),
|
||||
new XElement("add", new XAttribute("key", "WaitingTime"), new XAttribute("value", "600")),
|
||||
new XElement("add", new XAttribute("key", "autoUpdate"), new XAttribute("value", "Off")),
|
||||
new XElement("add", new XAttribute("key", "whatIsUrl"), new XAttribute("value", "http://whatismyip.akamai.com/,http://www.net.cn/static/customercare/yourip.asp")),
|
||||
new XElement("add", new XAttribute("key", "autoBoot"), new XAttribute("value", "Off")),
|
||||
new XElement("add", new XAttribute("key", "minimized"), new XAttribute("value", "Off")),
|
||||
new XElement("add", new XAttribute("key", "logautosave"), new XAttribute("value", "Off")),
|
||||
new XElement("add", new XAttribute("key", "TTL"), new XAttribute("value", "600")),
|
||||
new XElement("add", new XAttribute("key", "autoCheckUpdate"), new XAttribute("value", "Off")),
|
||||
new XElement("add", new XAttribute("key", "ngrokauto"), new XAttribute("value", "Off"))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -106,21 +106,18 @@
|
||||
this.timeSetGroup.Controls.Add(this.label3);
|
||||
this.timeSetGroup.Controls.Add(this.label_nextUpdateSeconds);
|
||||
this.timeSetGroup.Controls.Add(this.updateNow);
|
||||
this.timeSetGroup.Location = new System.Drawing.Point(18, 278);
|
||||
this.timeSetGroup.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.timeSetGroup.Location = new System.Drawing.Point(12, 185);
|
||||
this.timeSetGroup.Name = "timeSetGroup";
|
||||
this.timeSetGroup.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.timeSetGroup.Size = new System.Drawing.Size(302, 218);
|
||||
this.timeSetGroup.Size = new System.Drawing.Size(201, 145);
|
||||
this.timeSetGroup.TabIndex = 4;
|
||||
this.timeSetGroup.TabStop = false;
|
||||
this.timeSetGroup.Text = "其它设置";
|
||||
//
|
||||
// button_ngrok
|
||||
//
|
||||
this.button_ngrok.Location = new System.Drawing.Point(168, 80);
|
||||
this.button_ngrok.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_ngrok.Location = new System.Drawing.Point(112, 53);
|
||||
this.button_ngrok.Name = "button_ngrok";
|
||||
this.button_ngrok.Size = new System.Drawing.Size(118, 34);
|
||||
this.button_ngrok.Size = new System.Drawing.Size(79, 23);
|
||||
this.button_ngrok.TabIndex = 10;
|
||||
this.button_ngrok.Text = "ngrok设置";
|
||||
this.button_ngrok.UseVisualStyleBackColor = true;
|
||||
@ -129,10 +126,9 @@
|
||||
// checkBox_ngrok
|
||||
//
|
||||
this.checkBox_ngrok.AutoSize = true;
|
||||
this.checkBox_ngrok.Location = new System.Drawing.Point(14, 86);
|
||||
this.checkBox_ngrok.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkBox_ngrok.Location = new System.Drawing.Point(9, 57);
|
||||
this.checkBox_ngrok.Name = "checkBox_ngrok";
|
||||
this.checkBox_ngrok.Size = new System.Drawing.Size(115, 22);
|
||||
this.checkBox_ngrok.Size = new System.Drawing.Size(78, 16);
|
||||
this.checkBox_ngrok.TabIndex = 9;
|
||||
this.checkBox_ngrok.Text = "启用ngrok";
|
||||
this.checkBox_ngrok.UseVisualStyleBackColor = true;
|
||||
@ -141,10 +137,9 @@
|
||||
// checkBox_logAutoSave
|
||||
//
|
||||
this.checkBox_logAutoSave.AutoSize = true;
|
||||
this.checkBox_logAutoSave.Location = new System.Drawing.Point(14, 114);
|
||||
this.checkBox_logAutoSave.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkBox_logAutoSave.Location = new System.Drawing.Point(9, 76);
|
||||
this.checkBox_logAutoSave.Name = "checkBox_logAutoSave";
|
||||
this.checkBox_logAutoSave.Size = new System.Drawing.Size(142, 22);
|
||||
this.checkBox_logAutoSave.Size = new System.Drawing.Size(96, 16);
|
||||
this.checkBox_logAutoSave.TabIndex = 8;
|
||||
this.checkBox_logAutoSave.Text = "日志自动转储";
|
||||
this.checkBox_logAutoSave.UseVisualStyleBackColor = true;
|
||||
@ -153,10 +148,9 @@
|
||||
// checkBox_minimized
|
||||
//
|
||||
this.checkBox_minimized.AutoSize = true;
|
||||
this.checkBox_minimized.Location = new System.Drawing.Point(14, 57);
|
||||
this.checkBox_minimized.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkBox_minimized.Location = new System.Drawing.Point(9, 38);
|
||||
this.checkBox_minimized.Name = "checkBox_minimized";
|
||||
this.checkBox_minimized.Size = new System.Drawing.Size(142, 22);
|
||||
this.checkBox_minimized.Size = new System.Drawing.Size(96, 16);
|
||||
this.checkBox_minimized.TabIndex = 7;
|
||||
this.checkBox_minimized.Text = "启动时最小化";
|
||||
this.checkBox_minimized.UseVisualStyleBackColor = true;
|
||||
@ -165,10 +159,9 @@
|
||||
// checkBox_autoUpdate
|
||||
//
|
||||
this.checkBox_autoUpdate.AutoSize = true;
|
||||
this.checkBox_autoUpdate.Location = new System.Drawing.Point(14, 142);
|
||||
this.checkBox_autoUpdate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkBox_autoUpdate.Location = new System.Drawing.Point(9, 95);
|
||||
this.checkBox_autoUpdate.Name = "checkBox_autoUpdate";
|
||||
this.checkBox_autoUpdate.Size = new System.Drawing.Size(106, 22);
|
||||
this.checkBox_autoUpdate.Size = new System.Drawing.Size(72, 16);
|
||||
this.checkBox_autoUpdate.TabIndex = 6;
|
||||
this.checkBox_autoUpdate.Text = "自动更新";
|
||||
this.checkBox_autoUpdate.UseVisualStyleBackColor = true;
|
||||
@ -177,42 +170,38 @@
|
||||
// checkBox_autoBoot
|
||||
//
|
||||
this.checkBox_autoBoot.AutoSize = true;
|
||||
this.checkBox_autoBoot.Location = new System.Drawing.Point(14, 28);
|
||||
this.checkBox_autoBoot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkBox_autoBoot.Location = new System.Drawing.Point(9, 19);
|
||||
this.checkBox_autoBoot.Name = "checkBox_autoBoot";
|
||||
this.checkBox_autoBoot.Size = new System.Drawing.Size(124, 22);
|
||||
this.checkBox_autoBoot.Size = new System.Drawing.Size(132, 16);
|
||||
this.checkBox_autoBoot.TabIndex = 5;
|
||||
this.checkBox_autoBoot.Text = "随系统启动";
|
||||
this.checkBox_autoBoot.Text = "随系统启动自动运行";
|
||||
this.checkBox_autoBoot.UseVisualStyleBackColor = true;
|
||||
this.checkBox_autoBoot.CheckedChanged += new System.EventHandler(this.checkBox_autoBoot_CheckedChanged);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(176, 142);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Location = new System.Drawing.Point(117, 95);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(116, 18);
|
||||
this.label3.Size = new System.Drawing.Size(77, 12);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "秒后更新记录";
|
||||
//
|
||||
// label_nextUpdateSeconds
|
||||
//
|
||||
this.label_nextUpdateSeconds.ForeColor = System.Drawing.Color.Red;
|
||||
this.label_nextUpdateSeconds.Location = new System.Drawing.Point(130, 144);
|
||||
this.label_nextUpdateSeconds.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label_nextUpdateSeconds.Location = new System.Drawing.Point(87, 96);
|
||||
this.label_nextUpdateSeconds.Name = "label_nextUpdateSeconds";
|
||||
this.label_nextUpdateSeconds.Size = new System.Drawing.Size(45, 18);
|
||||
this.label_nextUpdateSeconds.Size = new System.Drawing.Size(30, 12);
|
||||
this.label_nextUpdateSeconds.TabIndex = 3;
|
||||
this.label_nextUpdateSeconds.Text = "60";
|
||||
this.label_nextUpdateSeconds.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// updateNow
|
||||
//
|
||||
this.updateNow.Location = new System.Drawing.Point(9, 176);
|
||||
this.updateNow.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.updateNow.Location = new System.Drawing.Point(6, 117);
|
||||
this.updateNow.Name = "updateNow";
|
||||
this.updateNow.Size = new System.Drawing.Size(278, 34);
|
||||
this.updateNow.Size = new System.Drawing.Size(185, 23);
|
||||
this.updateNow.TabIndex = 2;
|
||||
this.updateNow.Text = "立即更新";
|
||||
this.updateNow.UseVisualStyleBackColor = true;
|
||||
@ -230,11 +219,9 @@
|
||||
this.debugMessage.Controls.Add(this.globalRR);
|
||||
this.debugMessage.Controls.Add(this.label10);
|
||||
this.debugMessage.Controls.Add(this.label9);
|
||||
this.debugMessage.Location = new System.Drawing.Point(328, 70);
|
||||
this.debugMessage.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.debugMessage.Location = new System.Drawing.Point(219, 47);
|
||||
this.debugMessage.Name = "debugMessage";
|
||||
this.debugMessage.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.debugMessage.Size = new System.Drawing.Size(324, 118);
|
||||
this.debugMessage.Size = new System.Drawing.Size(216, 79);
|
||||
this.debugMessage.TabIndex = 5;
|
||||
this.debugMessage.TabStop = false;
|
||||
this.debugMessage.Text = "调试信息";
|
||||
@ -242,97 +229,91 @@
|
||||
// label_TTL
|
||||
//
|
||||
this.label_TTL.AutoSize = true;
|
||||
this.label_TTL.Location = new System.Drawing.Point(236, 66);
|
||||
this.label_TTL.Location = new System.Drawing.Point(157, 44);
|
||||
this.label_TTL.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label_TTL.Name = "label_TTL";
|
||||
this.label_TTL.Size = new System.Drawing.Size(62, 18);
|
||||
this.label_TTL.Size = new System.Drawing.Size(41, 12);
|
||||
this.label_TTL.TabIndex = 10;
|
||||
this.label_TTL.Text = "<null>";
|
||||
//
|
||||
// label15
|
||||
//
|
||||
this.label15.AutoSize = true;
|
||||
this.label15.Location = new System.Drawing.Point(196, 66);
|
||||
this.label15.Location = new System.Drawing.Point(131, 44);
|
||||
this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label15.Name = "label15";
|
||||
this.label15.Size = new System.Drawing.Size(44, 18);
|
||||
this.label15.Size = new System.Drawing.Size(29, 12);
|
||||
this.label15.TabIndex = 9;
|
||||
this.label15.Text = "TTL:";
|
||||
//
|
||||
// recordId
|
||||
//
|
||||
this.recordId.Location = new System.Drawing.Point(102, 27);
|
||||
this.recordId.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.recordId.Location = new System.Drawing.Point(68, 18);
|
||||
this.recordId.Name = "recordId";
|
||||
this.recordId.Size = new System.Drawing.Size(172, 28);
|
||||
this.recordId.Size = new System.Drawing.Size(116, 21);
|
||||
this.recordId.TabIndex = 8;
|
||||
this.recordId.Text = "<null>";
|
||||
//
|
||||
// globalValue
|
||||
//
|
||||
this.globalValue.AutoSize = true;
|
||||
this.globalValue.Location = new System.Drawing.Point(68, 94);
|
||||
this.globalValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.globalValue.Location = new System.Drawing.Point(45, 63);
|
||||
this.globalValue.Name = "globalValue";
|
||||
this.globalValue.Size = new System.Drawing.Size(62, 18);
|
||||
this.globalValue.Size = new System.Drawing.Size(41, 12);
|
||||
this.globalValue.TabIndex = 7;
|
||||
this.globalValue.Text = "<null>";
|
||||
//
|
||||
// globalDomainType
|
||||
//
|
||||
this.globalDomainType.AutoSize = true;
|
||||
this.globalDomainType.Location = new System.Drawing.Point(144, 66);
|
||||
this.globalDomainType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.globalDomainType.Location = new System.Drawing.Point(96, 44);
|
||||
this.globalDomainType.Name = "globalDomainType";
|
||||
this.globalDomainType.Size = new System.Drawing.Size(62, 18);
|
||||
this.globalDomainType.Size = new System.Drawing.Size(41, 12);
|
||||
this.globalDomainType.TabIndex = 6;
|
||||
this.globalDomainType.Text = "<null>";
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(9, 93);
|
||||
this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label12.Location = new System.Drawing.Point(6, 62);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(62, 18);
|
||||
this.label12.Size = new System.Drawing.Size(41, 12);
|
||||
this.label12.TabIndex = 5;
|
||||
this.label12.Text = "Value:";
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(100, 66);
|
||||
this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label11.Location = new System.Drawing.Point(67, 44);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(53, 18);
|
||||
this.label11.Size = new System.Drawing.Size(35, 12);
|
||||
this.label11.TabIndex = 4;
|
||||
this.label11.Text = "Type:";
|
||||
//
|
||||
// globalRR
|
||||
//
|
||||
this.globalRR.AutoSize = true;
|
||||
this.globalRR.Location = new System.Drawing.Point(39, 66);
|
||||
this.globalRR.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.globalRR.Location = new System.Drawing.Point(26, 44);
|
||||
this.globalRR.Name = "globalRR";
|
||||
this.globalRR.Size = new System.Drawing.Size(62, 18);
|
||||
this.globalRR.Size = new System.Drawing.Size(41, 12);
|
||||
this.globalRR.TabIndex = 3;
|
||||
this.globalRR.Text = "<null>";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(9, 66);
|
||||
this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label10.Location = new System.Drawing.Point(6, 44);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(35, 18);
|
||||
this.label10.Size = new System.Drawing.Size(23, 12);
|
||||
this.label10.TabIndex = 2;
|
||||
this.label10.Text = "RR:";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(10, 32);
|
||||
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label9.Location = new System.Drawing.Point(7, 21);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(80, 18);
|
||||
this.label9.Size = new System.Drawing.Size(53, 12);
|
||||
this.label9.TabIndex = 0;
|
||||
this.label9.Text = "RecordId";
|
||||
//
|
||||
@ -352,21 +333,18 @@
|
||||
this.globalSetGroup.Controls.Add(this.label5);
|
||||
this.globalSetGroup.Controls.Add(this.accessKeyId);
|
||||
this.globalSetGroup.Controls.Add(this.label4);
|
||||
this.globalSetGroup.Location = new System.Drawing.Point(328, 198);
|
||||
this.globalSetGroup.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.globalSetGroup.Location = new System.Drawing.Point(219, 132);
|
||||
this.globalSetGroup.Name = "globalSetGroup";
|
||||
this.globalSetGroup.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.globalSetGroup.Size = new System.Drawing.Size(324, 297);
|
||||
this.globalSetGroup.Size = new System.Drawing.Size(216, 198);
|
||||
this.globalSetGroup.TabIndex = 6;
|
||||
this.globalSetGroup.TabStop = false;
|
||||
this.globalSetGroup.Text = "设置";
|
||||
//
|
||||
// button_addNewDomain
|
||||
//
|
||||
this.button_addNewDomain.Location = new System.Drawing.Point(218, 254);
|
||||
this.button_addNewDomain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_addNewDomain.Location = new System.Drawing.Point(145, 169);
|
||||
this.button_addNewDomain.Name = "button_addNewDomain";
|
||||
this.button_addNewDomain.Size = new System.Drawing.Size(98, 34);
|
||||
this.button_addNewDomain.Size = new System.Drawing.Size(65, 23);
|
||||
this.button_addNewDomain.TabIndex = 17;
|
||||
this.button_addNewDomain.Text = "添加域名";
|
||||
this.button_addNewDomain.UseVisualStyleBackColor = true;
|
||||
@ -375,27 +353,28 @@
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Location = new System.Drawing.Point(12, 184);
|
||||
this.label13.Location = new System.Drawing.Point(8, 123);
|
||||
this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(71, 18);
|
||||
this.label13.Size = new System.Drawing.Size(47, 12);
|
||||
this.label13.TabIndex = 16;
|
||||
this.label13.Text = "TTL(秒)";
|
||||
//
|
||||
// textBox_TTL
|
||||
//
|
||||
this.textBox_TTL.Location = new System.Drawing.Point(98, 180);
|
||||
this.textBox_TTL.Location = new System.Drawing.Point(65, 120);
|
||||
this.textBox_TTL.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.textBox_TTL.Name = "textBox_TTL";
|
||||
this.textBox_TTL.Size = new System.Drawing.Size(54, 28);
|
||||
this.textBox_TTL.Size = new System.Drawing.Size(37, 21);
|
||||
this.textBox_TTL.TabIndex = 15;
|
||||
this.textBox_TTL.Text = "600";
|
||||
this.textBox_TTL.Leave += new System.EventHandler(this.textBox_TTL_Leave);
|
||||
//
|
||||
// button_ShowHide
|
||||
//
|
||||
this.button_ShowHide.Location = new System.Drawing.Point(112, 254);
|
||||
this.button_ShowHide.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_ShowHide.Location = new System.Drawing.Point(75, 169);
|
||||
this.button_ShowHide.Name = "button_ShowHide";
|
||||
this.button_ShowHide.Size = new System.Drawing.Size(98, 34);
|
||||
this.button_ShowHide.Size = new System.Drawing.Size(65, 23);
|
||||
this.button_ShowHide.TabIndex = 14;
|
||||
this.button_ShowHide.Text = "显示录入";
|
||||
this.button_ShowHide.UseVisualStyleBackColor = true;
|
||||
@ -403,10 +382,9 @@
|
||||
//
|
||||
// checkAndSaveConfig
|
||||
//
|
||||
this.checkAndSaveConfig.Location = new System.Drawing.Point(8, 254);
|
||||
this.checkAndSaveConfig.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.checkAndSaveConfig.Location = new System.Drawing.Point(5, 169);
|
||||
this.checkAndSaveConfig.Name = "checkAndSaveConfig";
|
||||
this.checkAndSaveConfig.Size = new System.Drawing.Size(98, 34);
|
||||
this.checkAndSaveConfig.Size = new System.Drawing.Size(65, 23);
|
||||
this.checkAndSaveConfig.TabIndex = 10;
|
||||
this.checkAndSaveConfig.Text = "测试连接";
|
||||
this.checkAndSaveConfig.UseVisualStyleBackColor = true;
|
||||
@ -415,19 +393,17 @@
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(160, 222);
|
||||
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label8.Location = new System.Drawing.Point(107, 148);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(98, 18);
|
||||
this.label8.Size = new System.Drawing.Size(65, 12);
|
||||
this.label8.TabIndex = 8;
|
||||
this.label8.Text = "秒更新一次";
|
||||
//
|
||||
// newSeconds
|
||||
//
|
||||
this.newSeconds.Location = new System.Drawing.Point(62, 218);
|
||||
this.newSeconds.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.newSeconds.Location = new System.Drawing.Point(41, 145);
|
||||
this.newSeconds.Name = "newSeconds";
|
||||
this.newSeconds.Size = new System.Drawing.Size(88, 28);
|
||||
this.newSeconds.Size = new System.Drawing.Size(60, 21);
|
||||
this.newSeconds.TabIndex = 7;
|
||||
this.newSeconds.Text = "60";
|
||||
this.newSeconds.Leave += new System.EventHandler(this.newSeconds_Leave);
|
||||
@ -435,40 +411,36 @@
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(9, 222);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label7.Location = new System.Drawing.Point(6, 148);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(44, 18);
|
||||
this.label7.Size = new System.Drawing.Size(29, 12);
|
||||
this.label7.TabIndex = 6;
|
||||
this.label7.Text = "每隔";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(9, 147);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label6.Location = new System.Drawing.Point(6, 98);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(80, 18);
|
||||
this.label6.Size = new System.Drawing.Size(53, 12);
|
||||
this.label6.TabIndex = 5;
|
||||
this.label6.Text = "完整域名";
|
||||
//
|
||||
// fullDomainName
|
||||
//
|
||||
this.fullDomainName.Location = new System.Drawing.Point(98, 142);
|
||||
this.fullDomainName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.fullDomainName.Location = new System.Drawing.Point(65, 95);
|
||||
this.fullDomainName.Name = "fullDomainName";
|
||||
this.fullDomainName.Size = new System.Drawing.Size(200, 28);
|
||||
this.fullDomainName.Size = new System.Drawing.Size(135, 21);
|
||||
this.fullDomainName.TabIndex = 4;
|
||||
this.fullDomainName.Text = "www.xxx.com";
|
||||
this.fullDomainName.Leave += new System.EventHandler(this.fullDomainName_Leave);
|
||||
//
|
||||
// accessKeySecret
|
||||
//
|
||||
this.accessKeySecret.Location = new System.Drawing.Point(12, 102);
|
||||
this.accessKeySecret.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.accessKeySecret.Location = new System.Drawing.Point(8, 68);
|
||||
this.accessKeySecret.Name = "accessKeySecret";
|
||||
this.accessKeySecret.PasswordChar = '*';
|
||||
this.accessKeySecret.Size = new System.Drawing.Size(286, 28);
|
||||
this.accessKeySecret.Size = new System.Drawing.Size(192, 21);
|
||||
this.accessKeySecret.TabIndex = 3;
|
||||
this.accessKeySecret.Text = "null";
|
||||
this.accessKeySecret.Leave += new System.EventHandler(this.accessKeySecret_Leave);
|
||||
@ -476,20 +448,18 @@
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(9, 80);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label5.Location = new System.Drawing.Point(6, 53);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(143, 18);
|
||||
this.label5.Size = new System.Drawing.Size(95, 12);
|
||||
this.label5.TabIndex = 2;
|
||||
this.label5.Text = "accessKeySecret";
|
||||
//
|
||||
// accessKeyId
|
||||
//
|
||||
this.accessKeyId.Location = new System.Drawing.Point(12, 44);
|
||||
this.accessKeyId.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.accessKeyId.Location = new System.Drawing.Point(8, 29);
|
||||
this.accessKeyId.Name = "accessKeyId";
|
||||
this.accessKeyId.PasswordChar = '*';
|
||||
this.accessKeyId.Size = new System.Drawing.Size(286, 28);
|
||||
this.accessKeyId.Size = new System.Drawing.Size(192, 21);
|
||||
this.accessKeyId.TabIndex = 1;
|
||||
this.accessKeyId.Text = "null";
|
||||
this.accessKeyId.Leave += new System.EventHandler(this.accessKeyId_Leave);
|
||||
@ -497,10 +467,9 @@
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(9, 21);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label4.Location = new System.Drawing.Point(6, 14);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(107, 18);
|
||||
this.label4.Size = new System.Drawing.Size(71, 12);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "accessKeyId";
|
||||
//
|
||||
@ -526,38 +495,37 @@
|
||||
this.ToolStripMenuItem_checkUpdate,
|
||||
this.ToolStripMenuItem_About});
|
||||
this.contextMenuStrip_sysTrayMenu.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip_sysTrayMenu.Size = new System.Drawing.Size(153, 88);
|
||||
this.contextMenuStrip_sysTrayMenu.Size = new System.Drawing.Size(125, 70);
|
||||
//
|
||||
// toolStripMenuItem_Exit
|
||||
//
|
||||
this.toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit";
|
||||
this.toolStripMenuItem_Exit.Size = new System.Drawing.Size(152, 28);
|
||||
this.toolStripMenuItem_Exit.Size = new System.Drawing.Size(124, 22);
|
||||
this.toolStripMenuItem_Exit.Text = "退出";
|
||||
this.toolStripMenuItem_Exit.Click += new System.EventHandler(this.toolStripMenuItem_Quit_Click);
|
||||
//
|
||||
// ToolStripMenuItem_checkUpdate
|
||||
//
|
||||
this.ToolStripMenuItem_checkUpdate.Name = "ToolStripMenuItem_checkUpdate";
|
||||
this.ToolStripMenuItem_checkUpdate.Size = new System.Drawing.Size(152, 28);
|
||||
this.ToolStripMenuItem_checkUpdate.Size = new System.Drawing.Size(124, 22);
|
||||
this.ToolStripMenuItem_checkUpdate.Text = "检查升级";
|
||||
this.ToolStripMenuItem_checkUpdate.Click += new System.EventHandler(this.ToolStripMenuItem_checkUPdate_Click);
|
||||
//
|
||||
// ToolStripMenuItem_About
|
||||
//
|
||||
this.ToolStripMenuItem_About.Name = "ToolStripMenuItem_About";
|
||||
this.ToolStripMenuItem_About.Size = new System.Drawing.Size(152, 28);
|
||||
this.ToolStripMenuItem_About.Size = new System.Drawing.Size(124, 22);
|
||||
this.ToolStripMenuItem_About.Text = "关于";
|
||||
this.ToolStripMenuItem_About.Click += new System.EventHandler(this.ToolStripMenuItem_About_Click);
|
||||
//
|
||||
// textBox_log
|
||||
//
|
||||
this.textBox_log.Location = new System.Drawing.Point(18, 502);
|
||||
this.textBox_log.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.textBox_log.Location = new System.Drawing.Point(12, 335);
|
||||
this.textBox_log.Multiline = true;
|
||||
this.textBox_log.Name = "textBox_log";
|
||||
this.textBox_log.ReadOnly = true;
|
||||
this.textBox_log.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textBox_log.Size = new System.Drawing.Size(632, 162);
|
||||
this.textBox_log.Size = new System.Drawing.Size(423, 109);
|
||||
this.textBox_log.TabIndex = 8;
|
||||
//
|
||||
// groupBox_netstate
|
||||
@ -568,11 +536,9 @@
|
||||
this.groupBox_netstate.Controls.Add(this.label2);
|
||||
this.groupBox_netstate.Controls.Add(this.localIP);
|
||||
this.groupBox_netstate.Controls.Add(this.label1);
|
||||
this.groupBox_netstate.Location = new System.Drawing.Point(18, 4);
|
||||
this.groupBox_netstate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.groupBox_netstate.Location = new System.Drawing.Point(12, 3);
|
||||
this.groupBox_netstate.Name = "groupBox_netstate";
|
||||
this.groupBox_netstate.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.groupBox_netstate.Size = new System.Drawing.Size(634, 57);
|
||||
this.groupBox_netstate.Size = new System.Drawing.Size(423, 38);
|
||||
this.groupBox_netstate.TabIndex = 9;
|
||||
this.groupBox_netstate.TabStop = false;
|
||||
this.groupBox_netstate.Text = "网络状态";
|
||||
@ -581,10 +547,9 @@
|
||||
//
|
||||
this.label_DomainIpStatus.AutoSize = true;
|
||||
this.label_DomainIpStatus.ForeColor = System.Drawing.Color.Red;
|
||||
this.label_DomainIpStatus.Location = new System.Drawing.Point(556, 28);
|
||||
this.label_DomainIpStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label_DomainIpStatus.Location = new System.Drawing.Point(371, 19);
|
||||
this.label_DomainIpStatus.Name = "label_DomainIpStatus";
|
||||
this.label_DomainIpStatus.Size = new System.Drawing.Size(62, 18);
|
||||
this.label_DomainIpStatus.Size = new System.Drawing.Size(41, 12);
|
||||
this.label_DomainIpStatus.TabIndex = 9;
|
||||
this.label_DomainIpStatus.Text = "未绑定";
|
||||
//
|
||||
@ -592,50 +557,45 @@
|
||||
//
|
||||
this.label_localIpStatus.AutoSize = true;
|
||||
this.label_localIpStatus.ForeColor = System.Drawing.Color.Red;
|
||||
this.label_localIpStatus.Location = new System.Drawing.Point(234, 28);
|
||||
this.label_localIpStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label_localIpStatus.Location = new System.Drawing.Point(156, 19);
|
||||
this.label_localIpStatus.Name = "label_localIpStatus";
|
||||
this.label_localIpStatus.Size = new System.Drawing.Size(62, 18);
|
||||
this.label_localIpStatus.Size = new System.Drawing.Size(41, 12);
|
||||
this.label_localIpStatus.TabIndex = 8;
|
||||
this.label_localIpStatus.Text = "未连接";
|
||||
//
|
||||
// domainIP
|
||||
//
|
||||
this.domainIP.AutoSize = true;
|
||||
this.domainIP.Location = new System.Drawing.Point(396, 28);
|
||||
this.domainIP.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.domainIP.Location = new System.Drawing.Point(264, 19);
|
||||
this.domainIP.Name = "domainIP";
|
||||
this.domainIP.Size = new System.Drawing.Size(71, 18);
|
||||
this.domainIP.Size = new System.Drawing.Size(47, 12);
|
||||
this.domainIP.TabIndex = 7;
|
||||
this.domainIP.Text = "0.0.0.0";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(327, 28);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Location = new System.Drawing.Point(218, 19);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(71, 18);
|
||||
this.label2.Size = new System.Drawing.Size(47, 12);
|
||||
this.label2.TabIndex = 6;
|
||||
this.label2.Text = "域名IP:";
|
||||
//
|
||||
// localIP
|
||||
//
|
||||
this.localIP.AutoSize = true;
|
||||
this.localIP.Location = new System.Drawing.Point(86, 28);
|
||||
this.localIP.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.localIP.Location = new System.Drawing.Point(57, 19);
|
||||
this.localIP.Name = "localIP";
|
||||
this.localIP.Size = new System.Drawing.Size(71, 18);
|
||||
this.localIP.Size = new System.Drawing.Size(47, 12);
|
||||
this.localIP.TabIndex = 5;
|
||||
this.localIP.Text = "0.0.0.0";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(8, 28);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Location = new System.Drawing.Point(5, 19);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(80, 18);
|
||||
this.label1.Size = new System.Drawing.Size(53, 12);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "WAN口IP:";
|
||||
//
|
||||
@ -647,21 +607,18 @@
|
||||
this.groupBox_setWanIp.Controls.Add(this.comboBox_whatIsUrl);
|
||||
this.groupBox_setWanIp.Controls.Add(this.button_whatIsTest);
|
||||
this.groupBox_setWanIp.Controls.Add(this.label14);
|
||||
this.groupBox_setWanIp.Location = new System.Drawing.Point(18, 70);
|
||||
this.groupBox_setWanIp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.groupBox_setWanIp.Location = new System.Drawing.Point(12, 47);
|
||||
this.groupBox_setWanIp.Name = "groupBox_setWanIp";
|
||||
this.groupBox_setWanIp.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.groupBox_setWanIp.Size = new System.Drawing.Size(302, 202);
|
||||
this.groupBox_setWanIp.Size = new System.Drawing.Size(201, 135);
|
||||
this.groupBox_setWanIp.TabIndex = 10;
|
||||
this.groupBox_setWanIp.TabStop = false;
|
||||
this.groupBox_setWanIp.Text = "WAN口IP设置";
|
||||
//
|
||||
// button_addUrl
|
||||
//
|
||||
this.button_addUrl.Location = new System.Drawing.Point(158, 99);
|
||||
this.button_addUrl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_addUrl.Location = new System.Drawing.Point(105, 66);
|
||||
this.button_addUrl.Name = "button_addUrl";
|
||||
this.button_addUrl.Size = new System.Drawing.Size(135, 34);
|
||||
this.button_addUrl.Size = new System.Drawing.Size(90, 23);
|
||||
this.button_addUrl.TabIndex = 21;
|
||||
this.button_addUrl.Text = "添加地址";
|
||||
this.button_addUrl.UseVisualStyleBackColor = true;
|
||||
@ -669,20 +626,18 @@
|
||||
//
|
||||
// maskedTextBox_setIP
|
||||
//
|
||||
this.maskedTextBox_setIP.Location = new System.Drawing.Point(10, 150);
|
||||
this.maskedTextBox_setIP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.maskedTextBox_setIP.Location = new System.Drawing.Point(7, 100);
|
||||
this.maskedTextBox_setIP.Mask = "000.000.000.000";
|
||||
this.maskedTextBox_setIP.Name = "maskedTextBox_setIP";
|
||||
this.maskedTextBox_setIP.PromptChar = ' ';
|
||||
this.maskedTextBox_setIP.Size = new System.Drawing.Size(157, 28);
|
||||
this.maskedTextBox_setIP.Size = new System.Drawing.Size(106, 21);
|
||||
this.maskedTextBox_setIP.TabIndex = 20;
|
||||
//
|
||||
// button_setIP
|
||||
//
|
||||
this.button_setIP.Location = new System.Drawing.Point(178, 148);
|
||||
this.button_setIP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_setIP.Location = new System.Drawing.Point(119, 99);
|
||||
this.button_setIP.Name = "button_setIP";
|
||||
this.button_setIP.Size = new System.Drawing.Size(114, 34);
|
||||
this.button_setIP.Size = new System.Drawing.Size(76, 23);
|
||||
this.button_setIP.TabIndex = 19;
|
||||
this.button_setIP.Text = "手工指定IP";
|
||||
this.button_setIP.UseVisualStyleBackColor = true;
|
||||
@ -691,23 +646,17 @@
|
||||
// comboBox_whatIsUrl
|
||||
//
|
||||
this.comboBox_whatIsUrl.FormattingEnabled = true;
|
||||
this.comboBox_whatIsUrl.Items.AddRange(new object[] {
|
||||
"http://whatismyip.akamai.com/",
|
||||
"http://www.net.cn/static/customercare/yourip.asp"});
|
||||
this.comboBox_whatIsUrl.Location = new System.Drawing.Point(9, 62);
|
||||
this.comboBox_whatIsUrl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.comboBox_whatIsUrl.Location = new System.Drawing.Point(6, 41);
|
||||
this.comboBox_whatIsUrl.Name = "comboBox_whatIsUrl";
|
||||
this.comboBox_whatIsUrl.Size = new System.Drawing.Size(282, 26);
|
||||
this.comboBox_whatIsUrl.Size = new System.Drawing.Size(189, 20);
|
||||
this.comboBox_whatIsUrl.TabIndex = 18;
|
||||
this.comboBox_whatIsUrl.Text = "http://whatismyip.akamai.com/";
|
||||
this.comboBox_whatIsUrl.Leave += new System.EventHandler(this.comboBox_whatIsUrl_Leave);
|
||||
//
|
||||
// button_whatIsTest
|
||||
//
|
||||
this.button_whatIsTest.Location = new System.Drawing.Point(9, 99);
|
||||
this.button_whatIsTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.button_whatIsTest.Location = new System.Drawing.Point(6, 66);
|
||||
this.button_whatIsTest.Name = "button_whatIsTest";
|
||||
this.button_whatIsTest.Size = new System.Drawing.Size(135, 34);
|
||||
this.button_whatIsTest.Size = new System.Drawing.Size(90, 23);
|
||||
this.button_whatIsTest.TabIndex = 17;
|
||||
this.button_whatIsTest.Text = "获取WAN口IP";
|
||||
this.button_whatIsTest.UseVisualStyleBackColor = true;
|
||||
@ -716,18 +665,17 @@
|
||||
// label14
|
||||
//
|
||||
this.label14.AutoSize = true;
|
||||
this.label14.Location = new System.Drawing.Point(10, 33);
|
||||
this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label14.Location = new System.Drawing.Point(7, 22);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(89, 18);
|
||||
this.label14.Size = new System.Drawing.Size(59, 12);
|
||||
this.label14.TabIndex = 16;
|
||||
this.label14.Text = "查询网址:";
|
||||
//
|
||||
// mainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(670, 676);
|
||||
this.ClientSize = new System.Drawing.Size(447, 451);
|
||||
this.Controls.Add(this.groupBox_setWanIp);
|
||||
this.Controls.Add(this.groupBox_netstate);
|
||||
this.Controls.Add(this.textBox_log);
|
||||
@ -736,7 +684,6 @@
|
||||
this.Controls.Add(this.timeSetGroup);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.Name = "mainForm";
|
||||
this.Text = "AliDDNS";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing);
|
||||
|
@ -106,10 +106,10 @@ namespace net.nutcore.aliddns
|
||||
}
|
||||
|
||||
//获取阿里云域名记录绑定IP
|
||||
domainIP.Text = getAliDnsRecordDomainIP();
|
||||
//domainIP.Text = getAliDnsRecordDomainIP();
|
||||
//获取WAN口IP
|
||||
localIP.Text = getWanIP();
|
||||
if ((localIP.Text != domainIP.Text) && (checkBox_autoBoot.Checked = true))
|
||||
//localIP.Text = getWanIP();
|
||||
if (checkBox_autoBoot.Checked == true)
|
||||
{
|
||||
updatePrepare();
|
||||
}
|
||||
@ -132,8 +132,16 @@ namespace net.nutcore.aliddns
|
||||
label_nextUpdateSeconds.Text = newSeconds.Text = cfg.GetAppSetting("WaitingTime").ToString();
|
||||
if (cfg.GetAppSetting("autoUpdate").ToString() == "On") checkBox_autoUpdate.Checked = true;
|
||||
else checkBox_autoUpdate.Checked = false;
|
||||
comboBox_whatIsUrl.Text = cfg.GetAppSetting("whatIsUrl").ToString();
|
||||
|
||||
if(cfg.GetAppSetting("whatIsUrl").ToString() != null)
|
||||
{
|
||||
string[] arrayUrl = cfg.GetAppSetting("whatIsUrl").ToString().Split(',');
|
||||
foreach(string strUrl in arrayUrl)
|
||||
{
|
||||
comboBox_whatIsUrl.Items.Add(strUrl.ToString().Trim());
|
||||
}
|
||||
comboBox_whatIsUrl.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
if (cfg.GetAppSetting("autoBoot").ToString() == "On") checkBox_autoBoot.Checked = true;
|
||||
else checkBox_autoBoot.Checked = false;
|
||||
|
||||
@ -172,41 +180,52 @@ namespace net.nutcore.aliddns
|
||||
/// <summary>
|
||||
/// 获取网络出口公网IP
|
||||
/// </summary>
|
||||
/// <param name="strUrl"></param>
|
||||
/// <returns></returns>
|
||||
private string getWanIP()
|
||||
private string getWanIP(string strUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
//从控件获取WAN口IP查询网址,默认值为:"http://whatismyip.akamai.com/";
|
||||
string strUrl = comboBox_whatIsUrl.Text;
|
||||
Uri uri = new Uri(strUrl);
|
||||
WebRequest webreq = WebRequest.Create(uri);
|
||||
Stream s = webreq.GetResponse().GetResponseStream();
|
||||
StreamReader sr = new StreamReader(s, Encoding.Default);
|
||||
string all = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
sr.Dispose();
|
||||
all = Regex.Replace(all, @"(\d+)", "000$1");
|
||||
all = Regex.Replace(all, @"0+(\d{1,4})", "$1");
|
||||
string reg = @"(\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})";
|
||||
Regex regex = new Regex(reg);
|
||||
Match match = regex.Match(all);
|
||||
string ip = match.Groups[1].Value;
|
||||
if (ip.Length > 0)
|
||||
if (strUrl != null)
|
||||
{
|
||||
label_localIpStatus.Text = "已连接";
|
||||
label_localIpStatus.ForeColor = System.Drawing.Color.FromArgb(0, 0, 0, 255);
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "成功获取WAN口IP:" + ip + "\r\n");
|
||||
Uri uri = new Uri(strUrl);
|
||||
WebRequest webreq = WebRequest.Create(uri);
|
||||
Stream s = webreq.GetResponse().GetResponseStream();
|
||||
StreamReader sr = new StreamReader(s, Encoding.Default);
|
||||
string all = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
sr.Dispose();
|
||||
all = Regex.Replace(all, @"(\d+)", "000$1");
|
||||
all = Regex.Replace(all, @"0+(\d{1,4})", "$1");
|
||||
string reg = @"(\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})";
|
||||
Regex regex = new Regex(reg);
|
||||
Match match = regex.Match(all);
|
||||
string ip = match.Groups[1].Value;
|
||||
if ((ip.Length > 0) && (ip.ToString() != "0.0.0.0"))
|
||||
{
|
||||
label_localIpStatus.Text = "已连接";
|
||||
label_localIpStatus.ForeColor = System.Drawing.Color.FromArgb(0, 0, 0, 255);
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "从" + strUrl + "成功获取WAN口IP:" + ip + "\r\n");
|
||||
//return ip;
|
||||
return Regex.Replace(ip, @"0*(\d+)", "$1");
|
||||
}
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "从" + strUrl + "返回IP是空值,查询失败!" + "\r\n");
|
||||
label_localIpStatus.Text = "未连接";
|
||||
label_localIpStatus.ForeColor = System.Drawing.Color.FromArgb(255, 255, 0, 0);
|
||||
return "0.0.0.0";
|
||||
}
|
||||
//return ip;
|
||||
return Regex.Replace(ip, @"0*(\d+)", "$1");
|
||||
else
|
||||
{
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "请检查配置文件查询网址设置!" + "\r\n");
|
||||
return "0.0.0.0";
|
||||
}
|
||||
return "0.0.0.0";
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "运行出错!信息: " + error + "\r\n");
|
||||
label_localIpStatus.Text = "未连接";
|
||||
label_localIpStatus.ForeColor = System.Drawing.Color.FromArgb(255,255,0,0);
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "获取WAN口IP失败,请检查设置!" + "\r\n");
|
||||
return "0.0.0.0";
|
||||
}
|
||||
}
|
||||
@ -439,7 +458,19 @@ namespace net.nutcore.aliddns
|
||||
private void updatePrepare()
|
||||
{
|
||||
label_nextUpdateSeconds.Text = newSeconds.Text;
|
||||
localIP.Text = getWanIP();
|
||||
string[] arrayUrl = cfg.GetAppSetting("whatIsUrl").ToString().Split(',');
|
||||
foreach (string strUrl in arrayUrl)
|
||||
{
|
||||
if ((localIP.Text = getWanIP(strUrl)) != "0.0.0.0")
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(localIP.Text.ToString() == "0.0.0.0")
|
||||
{
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "WAN口IP:" + localIP.Text + ",域名绑定IP更新停止,请检查查询网址设置或者手工指定IP!" + "\r\n");
|
||||
return;
|
||||
}
|
||||
domainIP.Text = getAliDnsRecordDomainIP();
|
||||
if (domainIP.Text == localIP.Text)
|
||||
{
|
||||
@ -529,7 +560,7 @@ namespace net.nutcore.aliddns
|
||||
private void button_whatIsTest_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "开始向网址发起查询... " + "\r\n");
|
||||
localIP.Text = getWanIP();
|
||||
localIP.Text = getWanIP(comboBox_whatIsUrl.Text.ToString().Trim());
|
||||
notifyIcon_sysTray_Update(); //监测网络状态、刷新系统托盘图标
|
||||
}
|
||||
|
||||
@ -838,8 +869,8 @@ namespace net.nutcore.aliddns
|
||||
|
||||
private void comboBox_whatIsUrl_Leave(object sender, EventArgs e)
|
||||
{
|
||||
cfg.SaveAppSetting("whatIsUrl", this.comboBox_whatIsUrl.Text.ToString());
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "公网IP查询网址修改保存成功!" + "\r\n");
|
||||
//cfg.SaveAppSetting("whatIsUrl", this.comboBox_whatIsUrl.Text.ToString());
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "公网IP查询网址已经修改,请测试并确定是否添加进配置文件!" + "\r\n");
|
||||
}
|
||||
|
||||
private void button_addNewDomain_Click(object sender, EventArgs e)
|
||||
@ -850,8 +881,17 @@ namespace net.nutcore.aliddns
|
||||
private void button_addUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
string newItem = comboBox_whatIsUrl.Text.Trim().ToLower().ToString();
|
||||
for(int i = 0; i < comboBox_whatIsUrl.Items.Count; i++)
|
||||
{
|
||||
if (newItem == comboBox_whatIsUrl.Items[i].ToString())
|
||||
{
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "填写的公网IP查询网址已经存在,无需重复添加!" + "\r\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
comboBox_whatIsUrl.Items.Add(newItem);
|
||||
cfg.AddAppSetting("whatIsUrl", newItem);
|
||||
textBox_log.AppendText(System.DateTime.Now.ToString() + " " + "新增公网IP查询网址保存成功!" + "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user