Skip to content

CtrlNet.Util is an application framework under.net core platform, which is composed of common operation class (tool class), third-party component encapsulation, third-party business interface encapsulation and so on.

License

Notifications You must be signed in to change notification settings

ctrlcommunity/CtrlNet.Util

Repository files navigation

CtrlNet.Util

CtrlNet.Util is an application framework under.net core platform, which is composed of common operation class (tool class), third-party component encapsulation, third-party business interface encapsulation and so on.

Nuget Packages

包名称 Nuget稳定版本 Nuget预览版本 下载数
CtrlNet.Util CtrlNet.Util CtrlNet.Util CtrlNet.Util

Use:

Install-Package CtrlNet.Util
  1. The current extended class includes Normal type conversions (String, DateTime, Int, Bool, Decimal, Double) Json serialization and deserialization String verification, judgment, conversion of Chinese pinyin, etc There are also some general validation judgments

  2. Security

2.1 the DES encryption

// encryption
Var encryptStr = DESEncrypt.Encrypt("XXXX");
// decryption
Var STR = DESEncrypt.Decrypt(encryptStr);

2.2 des encryption

// encryption
Var str = _3DESEncrypt.Encrypt ("123456");
// decryption
_3DESEncrypt.Decrypt(str);
  1. the Http
// synchronize
Var str = HttpMethods.Post("url", "jsondata");
Var str = HttpMethods.Get("url");
// asynchronous
Task<HttpResponseMessage> msg = HttpMethods.PostAsync("url ", "jsondata");
Task<HttpResponseMessage> msg = HttpMethods.GetAsync("url ");
  1. Guid operation
//Guid operations
Guid Guid = CombUtil.NewComb();
DateTime date = CombUtil.GetDateFromComb(guid);
  1. Binary serialization
// binary serialization
Var binary = new BinarySerializer().Serialize("obj");
Var obj = new BinarySerializer().Deserialize(binary);
  1. Excel operation
//export
ExcelHelper.ExportBytes(new List<object>(),new string [1]).
// import
ExcelHelper.ExcelImport<object>("filename");
  1. Add object mapping
//deep copy
MapperExtensions.Clone<Test>(test1);
//object creation
MapperExtensions.Map<TDestination>(source);
//Object creation
MapperExtensions.Map<TSource,TDestination>(source);
//merge
MapperExtensions.Map<TSource, TDestination>(source);

About

CtrlNet.Util is an application framework under.net core platform, which is composed of common operation class (tool class), third-party component encapsulation, third-party business interface encapsulation and so on.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages