Loading

摘要: public class AesHelper { /// <summary> /// AES加密 /// </summary> /// <param name="plainText">声明用于保存的字符串</param> /// <param name="Key">设置对称算法的密钥。</param 阅读全文
posted @ 2020-02-12 13:51 WeiYongZhi 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 定义的锁对象应该是 私有的,静态的,只读的,引用类型的对象,这样可以防止外部改变锁对象 private static readonly object Lock = new object(); 阅读全文
posted @ 2020-01-13 15:22 WeiYongZhi 阅读(145) 评论(0) 推荐(0) 编辑
摘要: <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Methods" value="OPTIONS,POST,GET"/> <add name="Access-Control-Allow- 阅读全文
posted @ 2019-12-28 13:49 WeiYongZhi 阅读(2504) 评论(0) 推荐(0) 编辑
摘要: public static class XSSFWorkbook_Excel { /// <summary> /// GetExcel /// </summary> /// <param name="list">结果结合</param> /// <param name="parms_header"> 阅读全文
posted @ 2019-12-21 17:23 WeiYongZhi 阅读(381) 评论(1) 推荐(0) 编辑
摘要: 调用异步方法前 HttpContext context = System.Web.HttpContext.Current; HttpRuntime.Cache.Insert("context", context); 异步方法里 HttpContext context = HttpContext.Cu 阅读全文
posted @ 2019-12-16 17:51 WeiYongZhi 阅读(1433) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplicati 阅读全文
posted @ 2019-12-07 11:36 WeiYongZhi 阅读(252) 评论(0) 推荐(0) 编辑
摘要: winform: protected override CreateParams CreateParams { get { const int WS_EX_APPWINDOW = 0x40000; const int WS_EX_TOOLWINDOW = 0x80; CreateParams cp 阅读全文
posted @ 2019-12-07 11:28 WeiYongZhi 阅读(752) 评论(0) 推荐(0) 编辑
摘要: 看到.net webapi中有[FromUri]来接收参数 可以将自动参数转换成字段属性的类型 baidu 了许多文章 都在自己造轮子 突然发下微软提供了这个方法 Convert.ChangeType() public static readonly BackArgs _args = new Bac 阅读全文
posted @ 2019-11-30 10:39 WeiYongZhi 阅读(1082) 评论(0) 推荐(0) 编辑
摘要: IsoDateTimeConverter _IsoDateTimeConverter = new IsoDateTimeConverter() { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }; var json = JsonConvert.SerializeOb 阅读全文
posted @ 2019-11-23 15:58 WeiYongZhi 阅读(217) 评论(0) 推荐(0) 编辑
摘要: var result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(dto2), Encoding.GetEncoding("UTF-8"), "application/json 阅读全文
posted @ 2019-11-23 15:56 WeiYongZhi 阅读(265) 评论(0) 推荐(0) 编辑