随笔分类 -  Utility

摘要:/// <summary> /// 用于方便使用Cookie的扩展工具类 /// </summary> public static class CookieExtension { // 我们可以为一些使用频率高的类型写专门的【读取】方法 /// <summary> /// 从一个Cookie中读取字 阅读全文
posted @ 2022-09-18 19:30 码农阿亮 阅读(55) 评论(0) 推荐(0)
摘要:/// <summary> /// 用于方便使用Cookie的扩展工具类 /// </summary> public static class CookieExtension { // 我们可以为一些使用频率高的类型写专门的【读取】方法 /// <summary> /// 从一个Cookie中读取字 阅读全文
posted @ 2022-09-07 10:19 码农阿亮 阅读(48) 评论(0) 推荐(0)
摘要:帮助类 /// <summary> /// 配置获取 /// </summary> public class DBConfig { public static string getBasicConn() { return ConfigurationManager.ConnectionStrings[ 阅读全文
posted @ 2022-08-16 19:12 码农阿亮 阅读(159) 评论(0) 推荐(0)
摘要:帮助类 /// <summary> /// OracleDBHelper 的摘要说明 /// </summary> public class OracleDBHelper { //Oracle 数据库连接 private static readonly string ConnectionString 阅读全文
posted @ 2022-08-16 18:55 码农阿亮 阅读(216) 评论(0) 推荐(0)
摘要:public class LogHelp { /// <summary> /// 记录指定的日志 /// </summary> /// <param name="logName">日志名</param> /// <param name="category">日志类别</param> /// <par 阅读全文
posted @ 2022-08-16 18:35 码农阿亮
摘要:public class VerifyCodeHelper { /// <summary> /// 传入一个随机字符串,生成一张Bitmap的图片 /// </summary> /// <param name="code"></param> /// <returns></returns> publi 阅读全文
posted @ 2022-08-14 12:17 码农阿亮 阅读(48) 评论(0) 推荐(0)
摘要:public class Net { /// <summary> /// 获取Ip /// </summary> public static string Ip { get { string text = string.Empty; bool flag = HttpContext.Current ! 阅读全文
posted @ 2022-07-26 20:18 码农阿亮 阅读(101) 评论(0) 推荐(0)
摘要:/// <summary> /// 文件上传帮助类 /// </summary> public class UploadHelper { /// <summary> /// 附件上传 成功:succeed、失败:error、文件太大:-1、 /// </summary> /// <param nam 阅读全文
posted @ 2022-07-26 20:16 码农阿亮 阅读(54) 评论(0) 推荐(0)
摘要:/// <summary> /// 汉字转换拼音 /// </summary> public class PinyinHelper { /// <summary> /// 将中文汉字转成拼音码 /// </summary> /// <param name="chineseStr">汉字字符</par 阅读全文
posted @ 2022-07-26 20:15 码农阿亮 阅读(71) 评论(0) 推荐(0)
摘要:public class Cache { private static Cache _cache = HttpRuntime.Cache; /// <summary> /// 本地缓存获取 /// </summary> /// <param name="name">key</param> /// < 阅读全文
posted @ 2022-07-26 20:10 码农阿亮 阅读(67) 评论(0) 推荐(0)
摘要:/// <summary> /// Web操作 /// </summary> public static class WebHelper { /// <summary> /// 获取主机名,即域名, /// 范例:用户输入网址http://www.a.com/b.htm?a=1&amp;b=2, / 阅读全文
posted @ 2022-07-26 20:10 码农阿亮 阅读(49) 评论(0) 推荐(0)
摘要:借鉴大佬的笔记笔记,记录方便查阅,一起学习呀~ xml增删改与读取操作 阅读全文
posted @ 2022-01-04 20:09 码农阿亮 阅读(155) 评论(0) 推荐(0)
摘要:一、定义Class using System; using System.Runtime.InteropServices; using System.Text; namespace IniDemo { public class IniFile { private string m_FileName; 阅读全文
posted @ 2021-11-29 10:50 码农阿亮 阅读(103) 评论(0) 推荐(0)
摘要:public static void WriteLog(string strLog) { string pathName = Environment.CurrentDirectory + "\\LOG\\" + DateTime.Now.ToString("yyyyMMdd"); string Fi 阅读全文
posted @ 2021-11-29 10:46 码农阿亮 阅读(164) 评论(0) 推荐(0)
摘要:private Dictionary<string, string> GenDictionary(byte[] inMsg) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); string arg= 阅读全文
posted @ 2021-11-29 10:44 码农阿亮 阅读(204) 评论(0) 推荐(0)
摘要:public class WcfChannelFactory { #region Wcf服务工厂 public static T CreateWCFServiceByURL<T>(string url) { return CreateWCFServiceByURL<T>(url, "wsHttpBi 阅读全文
posted @ 2021-11-24 16:57 码农阿亮 阅读(164) 评论(0) 推荐(0)
摘要:tnsnames.ora的配置 DB_NAME= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = IP)(PORT = 端口号)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = 实例名称) 阅读全文
posted @ 2021-11-05 15:38 码农阿亮 阅读(490) 评论(0) 推荐(0)
摘要:文件夹以及文件的简单操作 笔记1: string fileName = ""; //判断文件夹 Directory.Exists(Path); //移动文件夹 Directory.Move(Path, Path); //判断文件 File.Exists(Path + fileName); //创建文 阅读全文
posted @ 2021-11-05 15:35 码农阿亮 阅读(206) 评论(0) 推荐(0)
摘要:.NET中正则表达式学习笔记 一、匹配字符串 NO.1 //正则1 Regex r = new Regex("abc"); // 定义一个Regex对象实例 Match m = r.Match("123abc456"); // 在字符串中匹配 if (m.Success) { //匹配 } //正则 阅读全文
posted @ 2021-11-05 15:34 码农阿亮 阅读(120) 评论(0) 推荐(0)
摘要:Json与Object互转工具类 public static class Serialization { public static T JsonToObject<T>(string jsonText) { DataContractJsonSerializer dataContractJsonSer 阅读全文
posted @ 2021-11-05 15:33 码农阿亮 阅读(294) 评论(0) 推荐(0)