Files
ClientServerProject/ClientsLibrary/SoftUpdateSupport/FormUpdateRemote.cs

96 lines
2.6 KiB
C#
Raw Normal View History

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;
using ClientsLibrary.FileSupport;
namespace ClientsLibrary
{
2017-10-11 22:12:20 +08:00
/************************************************************************************************
*
*
*
*
*
**************************************************************************************************/
public partial class FormUpdateRemote : Form
{
2017-10-11 22:12:20 +08:00
#region Constructor
public FormUpdateRemote()
{
InitializeComponent();
Icon = UserSystem.GetFormWindowIcon();
}
2017-10-11 22:12:20 +08:00
#endregion
#region Select File And Upload
private void userButton_file_Click(object sender, EventArgs e)
{
using (OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
using (FormFileOperate fUpload = new FormFileOperate(
UserClient.Net_Update_Client,
ofd.FileNames,
"ClientFiles",
"",
""
))
{
fUpload.ShowDialog();
}
}
}
}
2017-10-11 22:12:20 +08:00
#endregion
#region Update Version
private void userButton_version_Click(object sender, EventArgs e)
{
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., textBox1.Text);
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
private void FormUpdateRemote_Load(object sender, EventArgs e)
{
textBox1.Text = UserClient.CurrentVersion.ToString();
}
2017-10-11 22:12:20 +08:00
#endregion
}
}