更新NuGet包到4.0.0,并完成相关的修改适配工作,v1.7.8
This commit is contained in:
@@ -55,7 +55,7 @@ namespace ClientsLibrary
|
||||
Thread.Sleep(200);
|
||||
|
||||
// 请求指令头数据,该数据需要更具实际情况更改
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.维护检查);
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.维护检查);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
byte[] temp = Encoding.Unicode.GetBytes(result.Content);
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace ClientsLibrary
|
||||
};
|
||||
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
CommonHeadCode.SimplifyHeadCode.上传头像MD5,
|
||||
json.ToString());
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace ClientsLibrary
|
||||
{
|
||||
// 初始化
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户, m_condition);
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户, m_condition);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
List<UserAccount> accounts = JArray.Parse(result.Content).ToObject<List<UserAccount>>();
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace ClientsLibrary
|
||||
account.EMail = textBox6.Text;
|
||||
|
||||
|
||||
OperateResultString result = net_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.注册账号, account.ToJsonString());
|
||||
OperateResult<string> result = net_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.注册账号, account.ToJsonString());
|
||||
if (result.IsSuccess && result.Content == "1")
|
||||
{
|
||||
MessageBox.Show("注册成功!");
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using HslCommunication.Core;
|
||||
|
||||
namespace ClientsLibrary
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ClientsLibrary
|
||||
|
||||
public partial class FormDownloading : Form
|
||||
{
|
||||
public FormDownloading(int customer,Action<OperateResultString> action)
|
||||
public FormDownloading(int customer,Action<OperateResult<string>> action)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -89,13 +89,13 @@ namespace ClientsLibrary
|
||||
|
||||
|
||||
private int net_cmd = 0;
|
||||
private Action<OperateResultString> DealWithResult = null;
|
||||
private Action<OperateResult<string>> DealWithResult = null;
|
||||
|
||||
private void ThreadRequestServer()
|
||||
{
|
||||
//后台请求数据
|
||||
System.Threading.Thread.Sleep(100);
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(net_cmd);
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(net_cmd);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
DealWithResult(result);
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<Reference Include="CommonLibrary">
|
||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
||||
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace ClientsLibrary.Configuration
|
||||
{
|
||||
// 初始化
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求信任客户端, "");
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求信任客户端, "");
|
||||
if(result.IsSuccess)
|
||||
{
|
||||
JObject json=JObject.Parse(result.Content);
|
||||
@@ -97,7 +97,7 @@ namespace ClientsLibrary.Configuration
|
||||
{ "TrustList", new JArray(list.ToArray()) }
|
||||
};
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
CommonLibrary.CommonHeadCode.SimplifyHeadCode.上传信任客户端, json.ToString());
|
||||
|
||||
if(result.IsSuccess)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ClientsLibrary.Configuration
|
||||
{
|
||||
// 初始化
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求信任客户端, "");
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求信任客户端, "");
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
JObject json = JObject.Parse(result.Content);
|
||||
@@ -61,7 +61,7 @@ namespace ClientsLibrary.Configuration
|
||||
{ "AllowFrameLogin", new JValue(checkBox2.Checked) },
|
||||
};
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
CommonLibrary.CommonHeadCode.SimplifyHeadCode.上传信任客户端, json.ToString());
|
||||
|
||||
if (result.IsSuccess)
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace ClientsLibrary.Configuration
|
||||
dataGridView1.Columns[0].HeaderText = HeadText;
|
||||
|
||||
// 向服务器请求数据初始化
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(Download, "");
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(Download, "");
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
@@ -124,7 +124,7 @@ namespace ClientsLibrary.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(Upload,
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(Upload,
|
||||
Newtonsoft.Json.Linq.JArray.FromObject(data).ToString());
|
||||
|
||||
if (result.IsSuccess)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ClientsLibrary.Configuration
|
||||
UILocalization();
|
||||
// 初始化
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求角色配置, "");
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.请求角色配置, "");
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
List<RoleItem> roles = JArray.Parse(result.Content).ToObject<List<RoleItem>>();
|
||||
@@ -210,7 +210,7 @@ namespace ClientsLibrary.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(
|
||||
CommonHeadCode.SimplifyHeadCode.上传角色配置, JArray.FromObject(roles).ToString());
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace ClientsLibrary
|
||||
|
||||
private void ReadFromServer(int head_code)
|
||||
{
|
||||
OperateResultString result = net_simplify_client.ReadFromServer(head_code);
|
||||
OperateResult<string> result = net_simplify_client.ReadFromServer(head_code);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
logNetAnalysisControl1.SetLogNetSource(result.Content);
|
||||
@@ -60,7 +60,7 @@ namespace ClientsLibrary
|
||||
|
||||
private void ClearFromServer(int head_code)
|
||||
{
|
||||
OperateResultString result = net_simplify_client.ReadFromServer(head_code);
|
||||
OperateResult<string> result = net_simplify_client.ReadFromServer(head_code);
|
||||
if (result.IsSuccess) MessageBox.Show("清除成功");
|
||||
else MessageBox.Show(result.ToMessageShowString());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace ClientsLibrary
|
||||
|
||||
private void userButton_version_Click(object sender, EventArgs e)
|
||||
{
|
||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更新版本, textBox1.Text);
|
||||
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更新版本, textBox1.Text);
|
||||
if (result.IsSuccess && result.Content == "1")
|
||||
{
|
||||
MessageBox.Show("更新成功!");
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace ClientsLibrary
|
||||
{ "Name", UserAccount.UserName },
|
||||
{ "Role", roleCode }
|
||||
};
|
||||
HslCommunication.OperateResultString result = Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.检查角色权限,
|
||||
HslCommunication.OperateResult<string> result = Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.检查角色权限,
|
||||
json.ToString());
|
||||
|
||||
if(result.IsSuccess)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="HslCommunication" version="3.17.15" targetFramework="net35" />
|
||||
<package id="HslCommunication" version="4.0.0" targetFramework="net35" />
|
||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user