Пример #1
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            IPAddress ip;
            int       iport = 0;

            if (cmbServerIP.Text == "")
            {
                MessageBox.Show("请选择或者填写服务IP!");
                cmbServerIP.Focus();
                return;
            }
            if (txtServerPort.Text == "")
            {
                MessageBox.Show("请填写服务端口号!");
                txtServerPort.Focus();
                return;
            }
            //回传接收IP
            if (!IPAddress.TryParse(cmbServerIP.Text.Trim(), out ip))
            {
                MessageBox.Show("服务IP为非IP类型,请重新输入!", "错误");
                cmbServerIP.Focus();
                return;
            }
            if (!int.TryParse(txtServerPort.Text.Trim(), out iport) ||
                iport < 0 || iport > 65536)
            {
                MessageBox.Show("服务端口应是介于0至65536间的数值,请重新输入!", "错误");
                txtServerPort.Focus();
                return;
            }
            ini.WriteValue("INFOSET", "ServerPort", txtServerPort.Text);
            ini.WriteValue("INFOSET", "ServerIP", cmbServerIP.Text);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtServer.Text.Trim() == "")
            {
                MessageBox.Show("服务器不能为空,请输入!", "提示");
                txtServer.Focus();
                return;
            }
            ;
            if (txtDb.Text.Trim() == "")
            {
                MessageBox.Show("数据库不能为空,请输入!", "提示");
                txtDb.Focus();
                return;
            }
            ;
            if (txtDbuser.Text.Trim() == "")
            {
                MessageBox.Show("数据库用户名不能为空,请输入!", "提示");
                txtDbuser.Focus();
                return;
            }
            ;
            //写INI文件
            IniFiles ini = new IniFiles(@Application.StartupPath + "\\Config.ini");

            ini.WriteValue("Database", "ServerName", txtServer.Text.Trim());
            ini.WriteValue("Database", "DataBase", txtDb.Text.Trim());
            ini.WriteValue("Database", "LogID", txtDbuser.Text.Trim());
        }
        private void btnSetFolder_Click(object sender, EventArgs e)
        {
            if (txtRevTar.Text == "")
            {
                MessageBox.Show("请选择接收Tar包文件夹路径!");
                return;
            }
            if (txtTarBuild.Text == "")
            {
                MessageBox.Show("请选择Tar包生成文件夹路径!");
                return;
            }
            if (txtUnTar.Text == "")
            {
                MessageBox.Show("请选择解压Tar包文件夹路径!");
                return;
            }
            if (txtXMLBuild.Text == "")
            {
                MessageBox.Show("请选择生成XML存放文件夹路径!");
                return;
            }
            if (txtBeUnTar.Text == "")
            {
                MessageBox.Show("请选择同步反馈解压Tar包文件夹路径!");
                return;
            }
            if (txtBeBuildXML.Text == "")
            {
                MessageBox.Show("请选择同步反馈生成XML文件夹路径!");
                return;
            }
            if (txtMedia.Text == "")
            {
                MessageBox.Show("请选择音频存放文件夹路径!");
                return;
            }

            inis.WriteValue("FolderSet", "RevTarFolder", txtRevTar.Text);
            inis.WriteValue("FolderSet", "UnTarFolder", txtUnTar.Text);
            inis.WriteValue("FolderSet", "SndTarFolder", txtTarBuild.Text);
            inis.WriteValue("FolderSet", "XmlBuildFolder", txtXMLBuild.Text);

            inis.WriteValue("FolderSet", "BeUnTarFolder", txtBeUnTar.Text);
            inis.WriteValue("FolderSet", "BeXmlFileMakeFolder", txtBeBuildXML.Text);
            inis.WriteValue("FolderSet", "AudioFileFolder", txtMedia.Text);
        }
Пример #4
0
 private void btnSet_Click(object sender, EventArgs e)
 {
     inis.WriteValue("INFOSET", "SourceID", txtSourceID.Text);
     inis.WriteValue("INFOSET", "SourceName", txtSourceName.Text);
     inis.WriteValue("INFOSET", "SourceType", txtSourceType.Text);
 }