更新NuGet包到4.0.0,并完成相关的修改适配工作,v1.7.8
This commit is contained in:
@@ -55,7 +55,7 @@ namespace ClientsLibrary
|
|||||||
Thread.Sleep(200);
|
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)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
byte[] temp = Encoding.Unicode.GetBytes(result.Content);
|
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,
|
CommonHeadCode.SimplifyHeadCode.上传头像MD5,
|
||||||
json.ToString());
|
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)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
List<UserAccount> accounts = JArray.Parse(result.Content).ToObject<List<UserAccount>>();
|
List<UserAccount> accounts = JArray.Parse(result.Content).ToObject<List<UserAccount>>();
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace ClientsLibrary
|
|||||||
account.EMail = textBox6.Text;
|
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")
|
if (result.IsSuccess && result.Content == "1")
|
||||||
{
|
{
|
||||||
MessageBox.Show("注册成功!");
|
MessageBox.Show("注册成功!");
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
|
||||||
namespace ClientsLibrary
|
namespace ClientsLibrary
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace ClientsLibrary
|
|||||||
|
|
||||||
public partial class FormDownloading : Form
|
public partial class FormDownloading : Form
|
||||||
{
|
{
|
||||||
public FormDownloading(int customer,Action<OperateResultString> action)
|
public FormDownloading(int customer,Action<OperateResult<string>> action)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
@@ -89,13 +89,13 @@ namespace ClientsLibrary
|
|||||||
|
|
||||||
|
|
||||||
private int net_cmd = 0;
|
private int net_cmd = 0;
|
||||||
private Action<OperateResultString> DealWithResult = null;
|
private Action<OperateResult<string>> DealWithResult = null;
|
||||||
|
|
||||||
private void ThreadRequestServer()
|
private void ThreadRequestServer()
|
||||||
{
|
{
|
||||||
//后台请求数据
|
//后台请求数据
|
||||||
System.Threading.Thread.Sleep(100);
|
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(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
DealWithResult(result);
|
DealWithResult(result);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
<Reference Include="CommonLibrary">
|
<Reference Include="CommonLibrary">
|
||||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<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>
|
<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)
|
if(result.IsSuccess)
|
||||||
{
|
{
|
||||||
JObject json=JObject.Parse(result.Content);
|
JObject json=JObject.Parse(result.Content);
|
||||||
@@ -97,7 +97,7 @@ namespace ClientsLibrary.Configuration
|
|||||||
{ "TrustList", new JArray(list.ToArray()) }
|
{ "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());
|
CommonLibrary.CommonHeadCode.SimplifyHeadCode.上传信任客户端, json.ToString());
|
||||||
|
|
||||||
if(result.IsSuccess)
|
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)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
JObject json = JObject.Parse(result.Content);
|
JObject json = JObject.Parse(result.Content);
|
||||||
@@ -61,7 +61,7 @@ namespace ClientsLibrary.Configuration
|
|||||||
{ "AllowFrameLogin", new JValue(checkBox2.Checked) },
|
{ "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());
|
CommonLibrary.CommonHeadCode.SimplifyHeadCode.上传信任客户端, json.ToString());
|
||||||
|
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace ClientsLibrary.Configuration
|
|||||||
dataGridView1.Columns[0].HeaderText = HeadText;
|
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)
|
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());
|
Newtonsoft.Json.Linq.JArray.FromObject(data).ToString());
|
||||||
|
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace ClientsLibrary.Configuration
|
|||||||
UILocalization();
|
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)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
List<RoleItem> roles = JArray.Parse(result.Content).ToObject<List<RoleItem>>();
|
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());
|
CommonHeadCode.SimplifyHeadCode.上传角色配置, JArray.FromObject(roles).ToString());
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace ClientsLibrary
|
|||||||
|
|
||||||
private void ReadFromServer(int head_code)
|
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)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
logNetAnalysisControl1.SetLogNetSource(result.Content);
|
logNetAnalysisControl1.SetLogNetSource(result.Content);
|
||||||
@@ -60,7 +60,7 @@ namespace ClientsLibrary
|
|||||||
|
|
||||||
private void ClearFromServer(int head_code)
|
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("清除成功");
|
if (result.IsSuccess) MessageBox.Show("清除成功");
|
||||||
else MessageBox.Show(result.ToMessageShowString());
|
else MessageBox.Show(result.ToMessageShowString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace ClientsLibrary
|
|||||||
|
|
||||||
private void userButton_version_Click(object sender, EventArgs e)
|
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")
|
if (result.IsSuccess && result.Content == "1")
|
||||||
{
|
{
|
||||||
MessageBox.Show("更新成功!");
|
MessageBox.Show("更新成功!");
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ namespace ClientsLibrary
|
|||||||
{ "Name", UserAccount.UserName },
|
{ "Name", UserAccount.UserName },
|
||||||
{ "Role", roleCode }
|
{ "Role", roleCode }
|
||||||
};
|
};
|
||||||
HslCommunication.OperateResultString result = Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.检查角色权限,
|
HslCommunication.OperateResult<string> result = Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.检查角色权限,
|
||||||
json.ToString());
|
json.ToString());
|
||||||
|
|
||||||
if(result.IsSuccess)
|
if(result.IsSuccess)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<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" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using HslCommunication;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
|
||||||
namespace CommonLibrary
|
namespace CommonLibrary
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace CommonLibrary
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 一个简单的混合锁,相比Lock速度更快
|
/// 一个简单的混合锁,相比Lock速度更快
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private HslCommunication.SimpleHybirdLock hybirdLock = new HslCommunication.SimpleHybirdLock();
|
private HslCommunication.Core.SimpleHybirdLock hybirdLock = new HslCommunication.Core.SimpleHybirdLock();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace CommonLibrary
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 列表锁
|
/// 列表锁
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private HslCommunication.SimpleHybirdLock hybirdLock = new HslCommunication.SimpleHybirdLock();
|
private HslCommunication.Core.SimpleHybirdLock hybirdLock = new HslCommunication.Core.SimpleHybirdLock();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断一个客户端的ID能否登录到系统
|
/// 判断一个客户端的ID能否登录到系统
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<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>
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace CommonLibrary
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
SoftBasic.FrameworkVersion = new SystemVersion("1.7.7");
|
SoftBasic.FrameworkVersion = new SystemVersion("1.7.8");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<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" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -140,7 +140,7 @@ namespace HslCommunicationNetTestTool
|
|||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
OperateResultString resultString = CurrentClient.ReadFromServer(handle, textBox2.Text);
|
OperateResult<string> resultString = CurrentClient.ReadFromServer(handle, textBox2.Text);
|
||||||
|
|
||||||
if (resultString.IsSuccess)
|
if (resultString.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<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>
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<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" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -223,7 +223,7 @@ namespace 软件系统客户端Wpf
|
|||||||
{
|
{
|
||||||
FormAccountManage fam = new FormAccountManage(() =>
|
FormAccountManage fam = new FormAccountManage(() =>
|
||||||
{
|
{
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
||||||
if (result.IsSuccess) return result.Content;
|
if (result.IsSuccess) return result.Content;
|
||||||
else return result.ToMessageShowString();
|
else return result.ToMessageShowString();
|
||||||
}, m => UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, m).IsSuccess);
|
}, m => UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, m).IsSuccess);
|
||||||
@@ -275,7 +275,7 @@ namespace 软件系统客户端Wpf
|
|||||||
{
|
{
|
||||||
using (FormSuper fs = new FormSuper(() =>
|
using (FormSuper fs = new FormSuper(() =>
|
||||||
{
|
{
|
||||||
OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
|
OperateResult<byte[]> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
|
||||||
//解析
|
//解析
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="HslCommunication" version="3.17.15" targetFramework="net45" />
|
<package id="HslCommunication" version="4.0.0" targetFramework="net45" />
|
||||||
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net45" />
|
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net45" />
|
||||||
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net45" />
|
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net45" />
|
||||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
<Reference Include="CommonLibrary">
|
<Reference Include="CommonLibrary">
|
||||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MaterialDesignColors, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MaterialDesignColors, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll</HintPath>
|
<HintPath>..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll</HintPath>
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ namespace 软件系统客户端模版
|
|||||||
{
|
{
|
||||||
FormAccountManage fam = new FormAccountManage(() =>
|
FormAccountManage fam = new FormAccountManage(() =>
|
||||||
{
|
{
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
||||||
if (result.IsSuccess) return result.Content;
|
if (result.IsSuccess) return result.Content;
|
||||||
else return result.ToMessageShowString();
|
else return result.ToMessageShowString();
|
||||||
}, m => UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, m).IsSuccess);
|
}, m => UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, m).IsSuccess);
|
||||||
@@ -309,7 +309,7 @@ namespace 软件系统客户端模版
|
|||||||
{
|
{
|
||||||
using (FormSuper fs = new FormSuper(() =>
|
using (FormSuper fs = new FormSuper(() =>
|
||||||
{
|
{
|
||||||
OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
|
OperateResult<byte[]> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
|
||||||
//解析
|
//解析
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<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" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
<Reference Include="CommonLibrary">
|
<Reference Include="CommonLibrary">
|
||||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<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>
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using CommonLibrary;
|
using CommonLibrary;
|
||||||
using HslCommunication;
|
using HslCommunication.Core;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -73,7 +73,7 @@ namespace 软件系统服务端模版.BasicSupport
|
|||||||
|
|
||||||
private List<NetAccount> OnlineClients = new List<NetAccount>(); // 所有在线客户端的列表
|
private List<NetAccount> OnlineClients = new List<NetAccount>(); // 所有在线客户端的列表
|
||||||
private SimpleHybirdLock hybirdLock = new SimpleHybirdLock(); // 操作列表的混合锁
|
private SimpleHybirdLock hybirdLock = new SimpleHybirdLock(); // 操作列表的混合锁
|
||||||
private string m_ClientsOnlineCache = "[]"; // 在线客户端的缓存
|
private string m_ClientsOnlineCache = "[]"; // 在线客户端的缓存
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using HslCommunication.BasicFramework;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using HslCommunication.LogNet;
|
using HslCommunication.LogNet;
|
||||||
using HslCommunication;
|
using HslCommunication;
|
||||||
|
using HslCommunication.Core;
|
||||||
using 软件系统服务端模版.BasicSupport;
|
using 软件系统服务端模版.BasicSupport;
|
||||||
|
|
||||||
|
|
||||||
@@ -929,7 +930,6 @@ namespace 软件系统服务端模版
|
|||||||
net_socket_server.ClientOnline += new NetBase.IEDelegate<AsyncStateOne>(Net_socket_server_ClientOnline);// 客户端上线触发
|
net_socket_server.ClientOnline += new NetBase.IEDelegate<AsyncStateOne>(Net_socket_server_ClientOnline);// 客户端上线触发
|
||||||
net_socket_server.ClientOffline += new NetBase.IEDelegate<AsyncStateOne, string>(Net_socket_server_ClientOffline);// 客户端下线触发,包括异常掉线
|
net_socket_server.ClientOffline += new NetBase.IEDelegate<AsyncStateOne, string>(Net_socket_server_ClientOffline);// 客户端下线触发,包括异常掉线
|
||||||
net_socket_server.AllClientsStatusChange += new NetBase.IEDelegate<string>(Net_socket_server_AllClientsStatusChange);// 客户端上下线变化时触发
|
net_socket_server.AllClientsStatusChange += new NetBase.IEDelegate<string>(Net_socket_server_AllClientsStatusChange);// 客户端上下线变化时触发
|
||||||
net_socket_server.MessageAlerts += new NetBase.IEDelegate<string>(Net_socket_server_MessageAlerts);// 服务器产生提示消息触发
|
|
||||||
net_socket_server.AcceptByte += new NetBase.IEDelegate<AsyncStateOne, NetHandle, byte[]>(Net_socket_server_AcceptByte);// 服务器接收到字节数据触发
|
net_socket_server.AcceptByte += new NetBase.IEDelegate<AsyncStateOne, NetHandle, byte[]>(Net_socket_server_AcceptByte);// 服务器接收到字节数据触发
|
||||||
net_socket_server.AcceptString += new NetBase.IEDelegate<AsyncStateOne, NetHandle, string>(Net_socket_server_AcceptString);// 服务器接收到字符串数据触发
|
net_socket_server.AcceptString += new NetBase.IEDelegate<AsyncStateOne, NetHandle, string>(Net_socket_server_AcceptString);// 服务器接收到字符串数据触发
|
||||||
net_socket_server.ServerStart(UserSystem.Port_Main_Net);
|
net_socket_server.ServerStart(UserSystem.Port_Main_Net);
|
||||||
@@ -984,11 +984,7 @@ namespace 软件系统服务端模版
|
|||||||
{
|
{
|
||||||
//如果此处充斥大量if语句,影响观感,则考虑进行指令头分类操作,客户端异步发送的字节数组都会到此处处理
|
//如果此处充斥大量if语句,影响观感,则考虑进行指令头分类操作,客户端异步发送的字节数组都会到此处处理
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Net_socket_server_MessageAlerts(string object1)
|
|
||||||
{
|
|
||||||
UserInterfaceMessageRender(object1 + Environment.NewLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Net_socket_server_ClientOffline(AsyncStateOne object1, string object2)
|
private void Net_socket_server_ClientOffline(AsyncStateOne object1, string object2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<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" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net35" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
<Reference Include="CommonLibrary">
|
<Reference Include="CommonLibrary">
|
||||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<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>
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
public ActionResult Login(FormCollection fc)
|
public ActionResult Login(FormCollection fc)
|
||||||
{
|
{
|
||||||
//请求指令头数据,该数据需要更具实际情况更改
|
//请求指令头数据,该数据需要更具实际情况更改
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.维护检查);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.维护检查);
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
//例如返回结果为1说明允许登录,0则说明服务器处于维护中,并将信息显示
|
//例如返回结果为1说明允许登录,0则说明服务器处于维护中,并将信息显示
|
||||||
@@ -230,7 +230,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
{ UserAccount.PasswordText, inputPassword1 }
|
{ UserAccount.PasswordText, inputPassword1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.密码修改, json.ToString());
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.密码修改, json.ToString());
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
return PartialViewMessage(MessageBoxStyle.success, "密码修改成功!");
|
return PartialViewMessage(MessageBoxStyle.success, "密码修改成功!");
|
||||||
@@ -281,7 +281,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
account.Grade = int.Parse(fc["grade"]);
|
account.Grade = int.Parse(fc["grade"]);
|
||||||
account.LoginEnable = bool.Parse(fc["loginEnable"]);
|
account.LoginEnable = bool.Parse(fc["loginEnable"]);
|
||||||
account.ForbidMessage = fc["reason"];
|
account.ForbidMessage = fc["reason"];
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.注册账号, account.ToJsonString());
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.注册账号, account.ToJsonString());
|
||||||
if (result.IsSuccess && result.Content == "1")
|
if (result.IsSuccess && result.Content == "1")
|
||||||
{
|
{
|
||||||
return PartialViewMessage(MessageBoxStyle.success, "账户注册成功!");
|
return PartialViewMessage(MessageBoxStyle.success, "账户注册成功!");
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
if (Request.IsAjaxRequest())
|
if (Request.IsAjaxRequest())
|
||||||
{
|
{
|
||||||
//对建议进行保存
|
//对建议进行保存
|
||||||
HslCommunication.OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.意见反馈, UserClient.UserAccount.UserName + ":" + advice);
|
HslCommunication.OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.意见反馈, UserClient.UserAccount.UserName + ":" + advice);
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
return PartialViewMessage(MessageBoxStyle.success, "建议提交成功!");
|
return PartialViewMessage(MessageBoxStyle.success, "建议提交成功!");
|
||||||
@@ -154,7 +154,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更新公告, announcement);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更新公告, announcement);
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
UserClient.Announcement = announcement;
|
UserClient.Announcement = announcement;
|
||||||
@@ -181,7 +181,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
[AuthorizeUser]
|
[AuthorizeUser]
|
||||||
public ActionResult ManagementAccount()
|
public ActionResult ManagementAccount()
|
||||||
{
|
{
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.获取账户);
|
||||||
if(result.IsSuccess)
|
if(result.IsSuccess)
|
||||||
{
|
{
|
||||||
ViewData["accounts"] = result.Content;
|
ViewData["accounts"] = result.Content;
|
||||||
@@ -210,7 +210,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
UserAccount account = Session[SessionItemsDescription.UserAccount] as UserAccount;
|
UserAccount account = Session[SessionItemsDescription.UserAccount] as UserAccount;
|
||||||
|
|
||||||
|
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, Accounts);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.更细账户, Accounts);
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
return PartialViewMessage(MessageBoxStyle.success, "账户更改成功!");
|
return PartialViewMessage(MessageBoxStyle.success, "账户更改成功!");
|
||||||
@@ -260,7 +260,7 @@ namespace 软件系统浏览器模版.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.群发消息, SendMessage);
|
OperateResult<string> result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.群发消息, SendMessage);
|
||||||
if (result.IsSuccess)
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
UserClient.Announcement = SendMessage;
|
UserClient.Announcement = SendMessage;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
|
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
|
||||||
<package id="bootstrap" version="3.3.7" targetFramework="net45" />
|
<package id="bootstrap" version="3.3.7" targetFramework="net45" />
|
||||||
<package id="HslCommunication" version="3.17.15" targetFramework="net45" />
|
<package id="HslCommunication" version="4.0.0" targetFramework="net45" />
|
||||||
<package id="jQuery" version="1.10.2" targetFramework="net45" />
|
<package id="jQuery" version="1.10.2" targetFramework="net45" />
|
||||||
<package id="jQuery.Validation" version="1.16.0" targetFramework="net45" />
|
<package id="jQuery.Validation" version="1.16.0" targetFramework="net45" />
|
||||||
<package id="Microsoft.ApplicationInsights" version="2.4.0" targetFramework="net45" />
|
<package id="Microsoft.ApplicationInsights" version="2.4.0" targetFramework="net45" />
|
||||||
|
|||||||
@@ -57,8 +57,8 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
<HintPath>..\CommonLibrary\bin\Debug\CommonLibrary.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HslCommunication, Version=3.17.15.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="HslCommunication, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HslCommunication.3.17.15\lib\HslCommunication.dll</HintPath>
|
<HintPath>..\packages\HslCommunication.4.0.0\lib\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.AI.Agent.Intercept, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.AI.Agent.Intercept, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.4.0\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
|
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.4.0\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
|
||||||
|
|||||||
Reference in New Issue
Block a user