2017-07-12 11:08:30 +08:00
|
|
|
|
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;
|
|
|
|
|
|
using HslCommunication;
|
|
|
|
|
|
using HslCommunication.Enthernet;
|
|
|
|
|
|
using CommonLibrary;
|
2017-10-01 15:59:37 +08:00
|
|
|
|
using ClientsLibrary.FileSupport;
|
2017-07-12 11:08:30 +08:00
|
|
|
|
|
|
|
|
|
|
namespace ClientsLibrary
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2017-10-11 22:12:20 +08:00
|
|
|
|
/************************************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 用途: 本窗口用于实现对本系统的客户端进行全面的远程更新的操作。
|
|
|
|
|
|
* 第一步: 先将新版本的所有客户端传送到服务器端进行覆盖。
|
|
|
|
|
|
* 第二步: 再将版本号传送到服务器进行更新,这样所有的客户端登录后就会自动更新新的版本了
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************************************/
|
2017-07-12 11:08:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public partial class FormUpdateRemote : Form
|
|
|
|
|
|
{
|
2017-10-11 22:12:20 +08:00
|
|
|
|
#region Constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-12 11:08:30 +08:00
|
|
|
|
public FormUpdateRemote()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2017-09-24 12:42:45 +08:00
|
|
|
|
|
2017-10-15 16:04:28 +08:00
|
|
|
|
Icon = UserSystem.GetFormWindowIcon();
|
2017-07-12 11:08:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-11 22:12:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Select File And Upload
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-12 11:08:30 +08:00
|
|
|
|
private void userButton_file_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
using (OpenFileDialog ofd = new OpenFileDialog())
|
|
|
|
|
|
{
|
|
|
|
|
|
ofd.Multiselect = true;
|
|
|
|
|
|
if (ofd.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
2017-09-17 21:59:45 +08:00
|
|
|
|
using (FormFileOperate fUpload = new FormFileOperate(
|
2017-10-01 15:59:37 +08:00
|
|
|
|
UserClient.Net_Update_Client,
|
2017-09-17 21:59:45 +08:00
|
|
|
|
ofd.FileNames,
|
|
|
|
|
|
"ClientFiles",
|
|
|
|
|
|
"",
|
|
|
|
|
|
""
|
|
|
|
|
|
))
|
2017-07-12 11:08:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
fUpload.ShowDialog();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-11 22:12:20 +08:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Update Version
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-12 11:08:30 +08:00
|
|
|
|
private void userButton_version_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2017-11-22 14:18:35 +08:00
|
|
|
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更新版本, textBox1.Text);
|
2017-07-12 11:08:30 +08:00
|
|
|
|
if (result.IsSuccess && result.Content == "1")
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("更新成功!");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("更新失败!原因:" + result.ToMessageShowString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-11 22:12:20 +08:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Form Load
|
|
|
|
|
|
|
2017-07-12 11:08:30 +08:00
|
|
|
|
private void FormUpdateRemote_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
textBox1.Text = UserClient.CurrentVersion.ToString();
|
|
|
|
|
|
}
|
2017-10-11 22:12:20 +08:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2017-07-12 11:08:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|