组件更新,代码优化,v1.5.6
This commit is contained in:
@@ -98,17 +98,7 @@ namespace CommonLibrary
|
||||
{
|
||||
return all_list_accounts.Where(selector).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将所有账户信息转换成另一种元素,并返回列表
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">目标类型</typeparam>
|
||||
/// <param name="converter">转换方法</param>
|
||||
/// <returns>转换后的结果列表</returns>
|
||||
public List<TResult> ConvertAll<TResult>(Converter<T, TResult> converter)
|
||||
{
|
||||
return all_list_accounts.ConvertAll(converter);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查账户信息,并返回账户对象
|
||||
@@ -210,6 +200,7 @@ namespace CommonLibrary
|
||||
public void DeleteAccount(string name)
|
||||
{
|
||||
hybirdLock.Enter();
|
||||
|
||||
for (int i = 0; i < all_list_accounts.Count; i++)
|
||||
{
|
||||
if (name == all_list_accounts[i].UserName)
|
||||
@@ -249,6 +240,19 @@ namespace CommonLibrary
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有的账户的用户名的JSON字符串
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetAccountsNamesJson()
|
||||
{
|
||||
string result = string.Empty;
|
||||
hybirdLock.Enter();
|
||||
result = JArray.FromObject(all_list_accounts.ConvertAll(m => m.UserName)).ToString();
|
||||
hybirdLock.Leave();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从所有的账户的json数据加载账户
|
||||
/// </summary>
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CommonLibrary
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
SoftBasic.FrameworkVersion = new SystemVersion("1.5.5");
|
||||
SoftBasic.FrameworkVersion = new SystemVersion("1.5.6");
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace CommonLibrary
|
||||
/// </summary>
|
||||
public static int Port_Udp_Server { get; } = 32566;
|
||||
/// <summary>
|
||||
/// 文件管理的服务器端口
|
||||
/// 用于服务器版本更新的端口
|
||||
/// </summary>
|
||||
public static int Port_Advanced_File_Server { get; } = 24672;
|
||||
|
||||
|
||||
Binary file not shown.
@@ -2127,28 +2127,37 @@
|
||||
服务器端的文件管理引擎终结点
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.DeleteFileBase(System.String)">
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.DeleteFileBase(System.String,System.String,System.String,System.String)">
|
||||
<summary>
|
||||
删除服务器上的文件
|
||||
</summary>
|
||||
<param name="fileName">文件的名称</param>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.DownloadFileBase(System.String,System.Action{System.Int64,System.Int64},System.String)">
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.DownloadFileBase(System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64},System.String)">
|
||||
<summary>
|
||||
基础下载文件信息
|
||||
</summary>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<param name="fileName">服务器的文件名称</param>
|
||||
<param name="processReport">下载的进度报告</param>
|
||||
<param name="fileSaveName">本地保存的文件名称,包含完整路径名</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.UploadFileBase(System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
|
||||
<member name="M:HslCommunication.Enthernet.FileClientBase.UploadFileBase(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
|
||||
<summary>
|
||||
上传文件给服务器
|
||||
</summary>
|
||||
<param name="fileName">本地完整路径的文件名</param>
|
||||
<param name="serverName">在服务器保存的文件名,不包含驱动器路径</param>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<param name="fileTag">文件的描述</param>
|
||||
<param name="fileUpload">文件的上传人</param>
|
||||
<param name="processReport">汇报进度</param>
|
||||
@@ -2329,11 +2338,14 @@
|
||||
<param name="result"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.Enthernet.UltimateFileServer.TransformFactFileName(System.String)">
|
||||
<member name="M:HslCommunication.Enthernet.UltimateFileServer.TransformFactFileName(System.String,System.String,System.String,System.String)">
|
||||
<summary>
|
||||
根据文件的显示名称转化为真实存储的名称
|
||||
</summary>
|
||||
<param name="tag">带分类功能的文件夹名称</param>
|
||||
<param name="factory">第一大类</param>
|
||||
<param name="group">第二大类</param>
|
||||
<param name="id">第三大类</param>
|
||||
<param name="fileName">文件显示名称</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.Enthernet.UltimateFileServer.ThreadPoolLogin(System.Object)">
|
||||
@@ -4096,6 +4108,55 @@
|
||||
<param name="filename">完整的文件路径</param>
|
||||
<returns>读写锁</returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.ReceiveInformationHead(System.Net.Sockets.Socket,System.Int32@,System.String@,System.String@,System.String@,System.String@,HslCommunication.OperateResult,System.String)">
|
||||
<summary>
|
||||
接收本次操作的信息头数据
|
||||
</summary>
|
||||
<param name="socket">网络套接字</param>
|
||||
<param name="command">命令</param>
|
||||
<param name="fileName">文件名</param>
|
||||
<param name="factory">第一大类</param>
|
||||
<param name="group">第二大类</param>
|
||||
<param name="id">第三大类</param>
|
||||
<param name="result">结果对象</param>
|
||||
<param name="failedString">失败的字符串</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.CreateRandomFileName">
|
||||
<summary>
|
||||
获取一个随机的文件名,由GUID码和随机数字组成
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.ReturnAbsoluteFilePath(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
返回服务器的绝对路径
|
||||
</summary>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.ReturnAbsoluteFileName(System.String,System.String,System.String,System.String)">
|
||||
<summary>
|
||||
返回服务器的绝对路径
|
||||
</summary>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<param name="fileName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.ReturnRelativeFileName(System.String,System.String,System.String,System.String)">
|
||||
<summary>
|
||||
返回相对路径的名称
|
||||
</summary>
|
||||
<param name="factory"></param>
|
||||
<param name="group"></param>
|
||||
<param name="id"></param>
|
||||
<param name="fileName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.MoveFileToNewFile(System.String,System.String)">
|
||||
<summary>
|
||||
移动一个文件到新的文件去
|
||||
@@ -4128,18 +4189,22 @@
|
||||
文件所存储的路径
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.GetDirectoryFiles(System.String)">
|
||||
<member name="M:HslCommunication.FileServerBase.GetDirectoryFiles(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
获取文件夹的所有文件列表
|
||||
</summary>
|
||||
<param name="segment">额外的片段名称</param>
|
||||
<param name="factory">第一大类</param>
|
||||
<param name="group">第二大类</param>
|
||||
<param name="id">第三大类</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:HslCommunication.FileServerBase.GetDirectories(System.String)">
|
||||
<member name="M:HslCommunication.FileServerBase.GetDirectories(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
获取文件夹的所有文件夹列表
|
||||
</summary>
|
||||
<param name="segment">额外的片段名称</param>
|
||||
<param name="factory">第一大类</param>
|
||||
<param name="group">第二大类</param>
|
||||
<param name="id">第三大类</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:HslCommunication.GroupFileContainer">
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace 软件系统服务端模版
|
||||
//在服务器的这个路径下,放置客户端运行的所有文件,不要包含settings文件,不要从此处运行
|
||||
//只放置exe和dll组件,必须放置:软件自动更新.exe
|
||||
net_soft_update_Server.KeyToken = CommonProtocol.KeyToken;
|
||||
net_soft_update_Server.FileUpdatePath = Application.StartupPath + @"\ServerFiles\ClientFiles";//客户端文件路径
|
||||
net_soft_update_Server.FileUpdatePath = Application.StartupPath + @"\AdvancedFiles\ClientFiles";//客户端文件路径
|
||||
net_soft_update_Server.ServerStart(CommonProtocol.Port_Update_Net);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -356,43 +356,6 @@ namespace 软件系统服务端模版
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 多文件服务器块
|
||||
|
||||
/**************************************************************************************
|
||||
*
|
||||
* 本文件管理器引擎目前主要实现1个功能
|
||||
* 1. 允许客户端上传服务器的客户端文件,用来提供软件自动更新使用的
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个高级的文件管理服务器引擎
|
||||
/// </summary>
|
||||
private AdvancedFileServer net_file_Advanced = new AdvancedFileServer();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化高级的文件管理引擎
|
||||
/// </summary>
|
||||
private void Net_File_Portrait_Initialization()
|
||||
{
|
||||
try
|
||||
{
|
||||
net_file_Advanced.FilesDirectoryPath = Application.StartupPath + @"\ServerFiles";
|
||||
net_file_Advanced.FilesDirectoryPathTemp = Application.StartupPath + @"\ServerFiles\Temp";
|
||||
net_file_Advanced.LogNet = new LogNetSingle(LogSavePath + @"\Advanced_file_log.txt");
|
||||
net_file_Advanced.KeyToken = CommonProtocol.KeyToken;
|
||||
net_file_Advanced.ServerStart(CommonProtocol.Port_Advanced_File_Server);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoftBasic.ShowExceptionMessage(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 同步数据传送引擎
|
||||
@@ -1151,6 +1114,43 @@ namespace 软件系统服务端模版
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Advanced File Server
|
||||
|
||||
/**************************************************************************************
|
||||
*
|
||||
* 本文件管理器引擎目前主要实现1个功能
|
||||
* 1. 允许客户端上传服务器的客户端文件,用来提供软件自动更新使用的
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个高级的文件管理服务器引擎
|
||||
/// </summary>
|
||||
private AdvancedFileServer net_file_Advanced = new AdvancedFileServer();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化高级的文件管理引擎
|
||||
/// </summary>
|
||||
private void Net_File_Portrait_Initialization()
|
||||
{
|
||||
try
|
||||
{
|
||||
net_file_Advanced.FilesDirectoryPath = Application.StartupPath + @"\AdvancedFiles";
|
||||
net_file_Advanced.FilesDirectoryPathTemp = Application.StartupPath + @"\AdvancedFiles\Temp";
|
||||
net_file_Advanced.LogNet = new LogNetSingle(LogSavePath + @"\Advanced_file_log.txt");
|
||||
net_file_Advanced.KeyToken = CommonProtocol.KeyToken;
|
||||
net_file_Advanced.ServerStart(CommonProtocol.Port_Advanced_File_Server);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SoftBasic.ShowExceptionMessage(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ultimate File Server
|
||||
@@ -1180,11 +1180,11 @@ namespace 软件系统服务端模版
|
||||
net_ultimate_file_server.KeyToken = CommonProtocol.KeyToken;
|
||||
net_ultimate_file_server.LogNet = new LogNetSingle(LogSavePath + @"\ultimate_file_log.txt");
|
||||
net_ultimate_file_server.LogNet.SetMessageDegree(HslMessageDegree.DEBUG);//默认debug及以上级别日志均进行存储,根据需要自行选择
|
||||
net_ultimate_file_server.FilesDirectoryPath = Application.StartupPath + @"\ServerFiles";
|
||||
net_ultimate_file_server.FilesDirectoryPath = Application.StartupPath + @"\UltimateFiles";
|
||||
net_ultimate_file_server.ServerStart(CommonProtocol.Port_Ultimate_File_Server);
|
||||
|
||||
// 共享文件管理器只是终极文件管理器的一个子容器
|
||||
ShareFileContainer = net_ultimate_file_server.GetGroupFromFilePath(Application.StartupPath + @"\ServerFiles\ShareFiles");
|
||||
ShareFileContainer = net_ultimate_file_server.GetGroupFromFilePath(Application.StartupPath + @"\UltimateFiles\ShareFiles");
|
||||
ShareFileContainer.FileCountChanged += ShareFileContainer_FileCountChanged;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user