2017-03-04 17:07:26 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
2017-05-05 23:07:44 +08:00
|
|
|
|
using HslCommunication.BasicFramework;
|
2017-03-04 17:07:26 +08:00
|
|
|
|
|
|
|
|
|
|
namespace CommonLibrary
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CommonLibrary
|
|
|
|
|
|
{
|
2017-05-05 23:07:44 +08:00
|
|
|
|
static CommonLibrary()
|
|
|
|
|
|
{
|
2017-06-29 08:10:53 +08:00
|
|
|
|
/**************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 时间:2017年6月29日 07:58:02
|
|
|
|
|
|
* 说明:更改版本机制,每次提交新增修订版的版本号
|
|
|
|
|
|
* 发行:发行版将采用主版本加次版本来发行
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-07 14:12:42 +08:00
|
|
|
|
/**************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 时间:2017年7月7日 14:11:35 版本号:1.1.0
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************/
|
2017-06-29 08:10:53 +08:00
|
|
|
|
|
2017-07-18 15:11:16 +08:00
|
|
|
|
/**************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 时间:2017年7月18日 15:10:18 版本号:1.2.0
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SoftBasic.FrameworkVersion = new SystemVersion("1.2.0");
|
2017-05-05 23:07:44 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-04 17:07:26 +08:00
|
|
|
|
#region 公用端口设计块
|
|
|
|
|
|
|
2017-03-05 18:32:55 +08:00
|
|
|
|
//======================================================================================
|
|
|
|
|
|
// 此处的所有的网络端口应该重新指定,防止其他人的项目连接到你的程序上
|
|
|
|
|
|
// 假设你们的多个项目服务器假设在一台电脑的情况,就绝对要替换下面的端口号
|
|
|
|
|
|
|
2017-03-04 17:07:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 主网络端口,此处随机定义了一个数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Main_Net { get; } = 17652;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 同步网络访问的端口,此处随机定义了一个数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Second_Net { get; } = 14568;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用于软件系统更新的端口,此处随机定义了一个数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Update_Net { get; } = 17538;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用于软件远程更新的端口,此处随机定义了一个数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Update_Remote { get; } = 26435;
|
2017-04-06 16:18:46 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 共享文件的端口号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Share_File { get; } = 34261;
|
2017-06-07 16:20:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用于UDP传输的端口号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Udp_Server { get; } = 32566;
|
2017-07-06 22:04:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 头像管理的服务器端口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static int Port_Portrait_Server { get; } = 24672;
|
2017-03-04 17:07:26 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2017-05-04 11:43:50 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 整个系统的加密解密密码
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public const string Security = "qwertyui";
|
2017-03-04 17:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-08 14:51:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选项类,包含了所有的标识和文本的对应关系
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class BasicOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 测试,用于生成数据状态的信息存储
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static readonly List<BasicOptions> test = new List<BasicOptions>()
|
|
|
|
|
|
{
|
|
|
|
|
|
new BasicOptions(0,"测试一"),
|
|
|
|
|
|
new BasicOptions(1,"测试二"),
|
|
|
|
|
|
new BasicOptions(2,"测试三"),
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 实例化一个对象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public BasicOptions()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据信息实例化一个选项对象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="code"></param>
|
|
|
|
|
|
/// <param name="des"></param>
|
|
|
|
|
|
public BasicOptions(int code, string des)
|
|
|
|
|
|
{
|
|
|
|
|
|
IntegerCode = code;
|
|
|
|
|
|
Description = des;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 整数的代号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int IntegerCode { get; set; } = 0;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 代号描述的文本
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Description { get; set; } = string.Empty;
|
2017-04-08 16:03:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 过去描述
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Description;
|
|
|
|
|
|
}
|
2017-04-08 14:51:25 +08:00
|
|
|
|
}
|
2017-03-04 17:07:26 +08:00
|
|
|
|
|
|
|
|
|
|
}
|