摘要: /// <summary> /// 全局锁 /// </summary> public static Object SyncObject = new object(); var syncObject = isTrans ? Util.SyncObject : new Object(); lock ( 阅读全文
posted @ 2016-12-01 16:53 菜鸟Only 阅读(153) 评论(0) 推荐(0) 编辑
摘要: using System.Web.Script.Serialization; /// <summary> /// 序列化器 /// </summary> private static readonly JavaScriptSerializer serializer; /// <summary> // 阅读全文
posted @ 2016-11-22 17:33 菜鸟Only 阅读(137) 评论(0) 推荐(0) 编辑
摘要: public static class SlGZip { /// <summary> /// 压缩 /// </summary> /// <param name="input">输入</param> /// <returns>结果</returns> public static string Com 阅读全文
posted @ 2016-11-22 10:40 菜鸟Only 阅读(186) 评论(0) 推荐(0) 编辑
摘要: class DesHelper { /// <summary> /// DES加密方法 /// </summary> /// <param name="prestr">待加密的字符串</param> /// <param name="key">加密的密码(只能为8位长)</param> /// <p 阅读全文
posted @ 2016-11-22 10:37 菜鸟Only 阅读(226) 评论(0) 推荐(0) 编辑
摘要: public class AesHelper { /// <summary> /// 生成128位的随机AES秘钥 /// </summary> public static void AutoCreateAesKey() { AesCryptoServiceProvider m_aesCryptoS 阅读全文
posted @ 2016-11-22 10:33 菜鸟Only 阅读(655) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// MD5签名 /// </summary> /// <param name="prestr">待签名字符串</param> /// <param name="key">密钥</param> /// <param name="charset">编码</param> / 阅读全文
posted @ 2016-11-22 10:30 菜鸟Only 阅读(1752) 评论(1) 推荐(0) 编辑
摘要: public string SHA1_Hash(string str_sha1_in) { SHA1 sha1 = new SHA1CryptoServiceProvider(); byte[] bytes_sha1_in = UTF8Encoding.Default.GetBytes(str_sh 阅读全文
posted @ 2016-11-22 10:27 菜鸟Only 阅读(443) 评论(0) 推荐(0) 编辑
摘要: StringBuilder MailLog = new StringBuilder(); string logPath = txtFile + str + DateTime.Now.ToString("yyyyMMdd") + ".txt"; Write(logPath, Context.DateF 阅读全文
posted @ 2016-11-21 17:39 菜鸟Only 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 对象序列化: /// <summary> /// 将一个对象序列化为XML字符串 /// </summary> /// <param name="o">要序列化的对象</param> /// <param name="encoding">编码方式</param> /// <returns>序列化产生 阅读全文
posted @ 2016-11-21 17:30 菜鸟Only 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 本方法引用 Aspose.Cells.dll,ICSharpCode.SharpZipLib.dll ,NPOI.dll,NPOI.OOXML.dll,NPOI.OpenXml4Net.dll,NPOI.OpenXmlFormats.dll static void Main(string[] arg 阅读全文
posted @ 2016-11-21 17:26 菜鸟Only 阅读(913) 评论(0) 推荐(0) 编辑