随笔分类 - C#
摘要:using Newtonsoft.Json;using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using NPOI.XSSF.UserModel;using System;using System.Collections.Generic;using
阅读全文
摘要:/// <summary> /// Memcached 帮助类 /// </summary> public class MemCachedHelper { /// <summary> /// 客户端 /// </summary> private static MemcachedClient _cli
阅读全文
摘要:public static string Encrypt(string str, string sKey, string iv) { string result = string.Empty; try { DESCryptoServiceProvider des = new DESCryptoSer
阅读全文
摘要:public class ValidateCodeHelper { /// <summary> /// 验证码的最大长度 /// </summary> public int MaxLength { get { return 10; } } /// <summary> /// 验证码的最小长度 ///
阅读全文
摘要:要控制执行时间,我们必须使用异步模式,在另外一个线程中执行方法,如果超时,则抛出异常终止线程执行。 如下实现的方法: public static void Main(string[] args) { //4秒后强制过期 CallWithTimeout(FiveSecondMethod, 4000);
阅读全文
摘要:利用C#编程,查看系统日志,介绍两个日志类:EventLog和EventLogEntry类,以及与系统日志进行交互。 .NET框架类库提供了EventLog类和EventLogEntry类与系统日志进行交互.二者属于System.Diagnostics命名空间 首先声明一变量:private Eve
阅读全文
浙公网安备 33010602011771号