摘要: /// <summary> /// 汉字转拼音类 /// </summary> public class PIN { private static int[] pyValue = new int[] { -20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20242,-20230,-20051,-20036, -20032,-20026,-20002,-19990,-19986,-19982,-19976,-19805,-19784,-19775,-19... 阅读全文
posted @ 2012-08-29 16:02 暗尘掩月 阅读(410) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 序列和反序列化 /// </summary> public class NVCSpecialized { /// <summary> /// 将字符串序列化<see cref="System.Collections.Specialized.NameValueCollection"/>类型,第一个为键,第二位与其相对应的值。 /// </summary> /// <param name="keys">NameValueCollection中的keys 阅读全文
posted @ 2012-08-29 16:01 暗尘掩月 阅读(162) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 日志类 /// </summary> /// <remarks> /// 当调用Write方法时不会造成线程阻塞,而是立即完成方法调用,因此调用线程不用等待日志写入文件之后才返回。 /// </remarks> public class Logger { /// <summary> /// 写日志 /// </summary> /// <param name="text">错误描述</param> public static void Writ 阅读全文
posted @ 2012-08-29 16:00 暗尘掩月 阅读(500) 评论(0) 推荐(0) 编辑
摘要: public class Js { /// <summary> /// 显示消息提示对话框,不输出页面内容,并返回上一页 /// </summary> /// <param name="page">当前页面指针</param> /// <param name="msg">提示信息</param> /// <returns></returns> public static void ShowAndBack(System.Web.UI.Page page, str 阅读全文
posted @ 2012-08-29 16:00 暗尘掩月 阅读(475) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 利用纯真IP数据库(QQWry.dat)查询IP所在地 /// 优点:查询速度快、方便更新IP库 /// </summary> public static class IPScanner { private static string dataPath = HttpContext.Current.Server.MapPath("/Plugin/qqwry.dat"); private static string ip; private static string country; ... 阅读全文
posted @ 2012-08-29 15:59 暗尘掩月 阅读(397) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 图片操作:生成缩略图、添加水印、截取图片等 /// </summary> public class ImagesHelper { /// <summary> /// 根据文件流获得图片宽度 /// </summary> /// <param name="file"></param> /// <returns></returns> public static int getImgWidth(Stream stream) { ... 阅读全文
posted @ 2012-08-29 15:58 暗尘掩月 阅读(208) 评论(0) 推荐(0) 编辑
摘要: public class HttpClient { #region fields private bool keepContext; private string defaultLanguage = "zh-CN"; private Encoding defaultEncoding = Encoding.UTF8; private string accept = "*/*"; private string userAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Wi... 阅读全文
posted @ 2012-08-29 15:58 暗尘掩月 阅读(307) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 返回系统CPU占用百分比 /// </summary> public class GetCPU { public static int GetCpuUsage() { return CpuUsage.Create().Query(); } public abstract class CpuUsage { private static GetCPU.CpuUsage m_CpuUsage; protec... 阅读全文
posted @ 2012-08-29 15:57 暗尘掩月 阅读(221) 评论(0) 推荐(0) 编辑
摘要: public class FusionCharts { /// <summary> /// encodes the dataURL before it's served to FusionCharts /// If you have parameters in your dataURL, you'll necessarily need to encode it /// </summary> /// <param name="dataURL">dataURL to be fed to chart</param> 阅读全文
posted @ 2012-08-29 15:56 暗尘掩月 阅读(146) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 文本文件从磁盘读取、写入 /// </summary> public class FileHelper { /// <summary> /// 从文件中读取文本内容 /// </summary> /// <param name="filePath">文本路径</param> /// <returns>返回文件中的内容</returns> public static string Read(string filePath) ... 阅读全文
posted @ 2012-08-29 15:54 暗尘掩月 阅读(261) 评论(0) 推荐(0) 编辑