|
|
|
|
|
using GeoSigmaDrawLib;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaDrawLib
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 许可服务器设置窗体.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class FrmLicenseServerConfig : Form
|
|
|
|
|
|
{
|
|
|
|
|
|
private string message = string.Empty;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets 消息.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Message
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return message;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
message = value;
|
|
|
|
|
|
this.lblServerInfo.Text = message;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private string url = "127.0.0.1:9527";
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets IP.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Url
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return url;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (url?.Equals(value) == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
url = value;
|
|
|
|
|
|
this.txtIP.Text = url;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="FrmLicenseServerConfig"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public FrmLicenseServerConfig()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 测试服务器连接事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private async void btnTest_ClickAsync(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strUrl = txtIP.Text;
|
|
|
|
|
|
btnTest.Enabled = false;
|
|
|
|
|
|
lblServerInfo.Text = "正在执行测试 ... ... ";
|
|
|
|
|
|
LicenseServerConnection licenseServer = new LicenseServerConnection();
|
|
|
|
|
|
ReplyMessage msg = await licenseServer.TestServerAsync(strUrl);
|
|
|
|
|
|
if (msg.Code == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
lblServerInfo.Text = "测试成功:" + msg.Message;
|
|
|
|
|
|
//MessageBox.Show(this, msg.Message, "连接成功", MessageBoxButtons.OK);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lblServerInfo.Text = "测试失败:" + msg.Message;
|
|
|
|
|
|
//MessageBox.Show(this, msg.Message, "连接失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
|
}
|
|
|
|
|
|
btnTest.Enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 确定按钮点击事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.url = this.txtIP.Text;
|
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 取消按钮点击事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|