135 lines
4.9 KiB
C#
135 lines
4.9 KiB
C#
|
|
using System;
|
|||
|
|
using System.Reflection;
|
|||
|
|
using CYQ.Data.Json;
|
|||
|
|
using CYQ.Data.Tool;
|
|||
|
|
namespace CYQ.Data
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
internal static class AppConst
|
|||
|
|
{
|
|||
|
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
internal static readonly string Github = "https://github.com/cyq1162/cyqdata";
|
|||
|
|
internal static readonly string Host = "cyqdata.com";
|
|||
|
|
internal static readonly string Host_Aries = "aries.cyqdata.com";
|
|||
|
|
internal static readonly string Host_Taurus = "taurus.cyqdata.com";
|
|||
|
|
internal static readonly string Host_Lic = "lic.cyqdata.com";
|
|||
|
|
#endregion
|
|||
|
|
#region License <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
//internal const string Lic_Error_Contact = "\r\nContact email:cyq1162@126.com;QQ:272657997\r\n site : http://www.cyqdata.com/cyqdata";
|
|||
|
|
////internal const string Lic_Error_AtNight = "Sorry ! You need to get a license key when you run it at night!";
|
|||
|
|
//internal const string Lic_Error_NotBuyProvider = "Sorry ! Your license key not contains this provider function : ";
|
|||
|
|
//internal const string Lic_Error_InvalidVersion = "Sorry ! Your license key version invalid!";
|
|||
|
|
//internal const string Lic_Error_InvalidKey = "Sorry ! Your license key is invalid!";
|
|||
|
|
//internal const string Lic_PublicKey = "CYQ.Data.License";
|
|||
|
|
//internal const string Lic_UseKeyFileName = "cyq.data.keys";
|
|||
|
|
////internal const string Lic_DevKeyFileName = "/cyq.data.dev.keys";
|
|||
|
|
//internal const string Lic_MacKeyType = "mac";
|
|||
|
|
//internal const string Lic_DllKeyType = "dll";
|
|||
|
|
//internal const string Lic_AriesCore = "Aries.Core";
|
|||
|
|
//internal const string Lic_AriesLogic = "Aries.Logic";
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region ȫ<EFBFBD><EFBFBD>
|
|||
|
|
internal static readonly string FilePre = "file:";
|
|||
|
|
internal static readonly string Result = ".Result";
|
|||
|
|
internal static readonly string Global_NotImplemented = "The method or operation is not implemented.";
|
|||
|
|
internal static readonly string ACKey = "4pMxvlk1OlOv0K6z96T+mNDBdEkX6mPa7Yq27cWP/u0#=2";
|
|||
|
|
internal static readonly string ALKey = "YH/xArdNhygAvQ7NwJiq2HreAmphvcTP7Yq27cWP/u0#=2";
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>Ч<EFBFBD><D0A7><EFBFBD>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD>ַ<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
internal static char[] InvalidFileNameChars = System.IO.Path.GetInvalidFileNameChars();
|
|||
|
|
private static string _HR;
|
|||
|
|
|
|||
|
|
internal static string HR
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (string.IsNullOrEmpty(_HR))
|
|||
|
|
{
|
|||
|
|
_HR = AppConfig.IsWeb ? "<hr />" : NewLine + "<---END--->" + NewLine;
|
|||
|
|
}
|
|||
|
|
return _HR;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_HR = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private static string _BR;
|
|||
|
|
|
|||
|
|
internal static string BR
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (string.IsNullOrEmpty(_BR))
|
|||
|
|
{
|
|||
|
|
_BR = AppConfig.IsWeb ? "<br />" : NewLine;
|
|||
|
|
}
|
|||
|
|
return _BR;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_BR = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
internal static string NewLine
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return Environment.NewLine;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
internal static string SplitChar = "$,$";
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
internal static string _DLLFullName = string.Empty;
|
|||
|
|
static string _RunfolderPath;
|
|||
|
|
internal static string HNKey = LocalEnvironment.HostName;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD>ܵij<DCB5><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
/// </summary>
|
|||
|
|
internal static string AssemblyPath
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (string.IsNullOrEmpty(_RunfolderPath))
|
|||
|
|
{
|
|||
|
|
Assembly ass = System.Reflection.Assembly.GetExecutingAssembly();
|
|||
|
|
_DLLFullName = ass.FullName;
|
|||
|
|
_RunfolderPath = ass.CodeBase;
|
|||
|
|
_RunfolderPath = System.IO.Path.GetDirectoryName(_RunfolderPath);
|
|||
|
|
_RunfolderPath = _RunfolderPath.Replace(AppConst.FilePre, string.Empty).TrimStart('\\');
|
|||
|
|
if (_RunfolderPath.Contains("\\"))
|
|||
|
|
{
|
|||
|
|
_RunfolderPath += "\\";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
_RunfolderPath += "/";
|
|||
|
|
}
|
|||
|
|
ass = null;
|
|||
|
|
}
|
|||
|
|
return _RunfolderPath;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD><EFBFBD>Գ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
public static Type JsonIgnoreType = typeof(JsonIgnoreAttribute);
|
|||
|
|
public static Type JsonFormatType = typeof(JsonFormatAttribute);
|
|||
|
|
public static Type JsonEnumToStringType = typeof(JsonEnumToStringAttribute);
|
|||
|
|
public static Type JsonEnumToDescriptionType = typeof(JsonEnumToDescriptionAttribute);
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|