You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ClientTest
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
*类名称:ServerIPPortInputForm
|
|
|
|
|
*创建人:韩荣伟
|
|
|
|
|
*创建时间:2010-10-30
|
|
|
|
|
*功能描述:服务器ip与端口设置窗口
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public partial class ServerIPPortInputForm : Form
|
|
|
|
|
{
|
|
|
|
|
public string sIP;
|
|
|
|
|
public int nPort;
|
|
|
|
|
|
|
|
|
|
public ServerIPPortInputForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
*方法名称:LoadIPPort
|
|
|
|
|
*创建人:韩荣伟
|
|
|
|
|
*创建时间:2010-10-30
|
|
|
|
|
*参数描述:string sIP 服务器ip, string sPort 服务器端口
|
|
|
|
|
*返回描述:void
|
|
|
|
|
*功能描述:初始化ip和端口
|
|
|
|
|
*/
|
|
|
|
|
public void LoadIPPort(string sIP, string sPort)
|
|
|
|
|
{
|
|
|
|
|
tbServerIP.Text = sIP;
|
|
|
|
|
tbServerPort.Text = sPort;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
*方法名称:btnApply_Click
|
|
|
|
|
*创建人:韩荣伟
|
|
|
|
|
*创建时间:2010-10-30
|
|
|
|
|
*参数描述:object sender 事件发起者, EventArgs e 事件参数
|
|
|
|
|
*返回描述:void
|
|
|
|
|
*功能描述:执行设置
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
private void btnApply_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DialogResult result = MessageBox.Show("重设目标服务器IP和端口,有可能导致采集器不能联网。请确认是否继续?",
|
|
|
|
|
"注意", MessageBoxButtons.OKCancel,
|
|
|
|
|
MessageBoxIcon.Warning);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result == DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
sIP = tbServerIP.Text;
|
|
|
|
|
nPort = Convert.ToInt32(tbServerPort.Text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|