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稳定版本 | Nuget预览版本 | 下载数 |
---|---|---|---|
CtrlNet.Util |
Use:
Install-Package CtrlNet.Util
-
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
-
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);
- 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 ");
- Guid operation
//Guid operations
Guid Guid = CombUtil.NewComb();
DateTime date = CombUtil.GetDateFromComb(guid);
- Binary serialization
// binary serialization
Var binary = new BinarySerializer().Serialize("obj");
Var obj = new BinarySerializer().Deserialize(binary);
- Excel operation
//export
ExcelHelper.ExportBytes(new List<object>(),new string [1]).
// import
ExcelHelper.ExcelImport<object>("filename");
- 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);