![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
工具类
狮主
这个作者很懒,什么都没留下…
展开
-
C# DateTime 转文本,例如:1年前,3个月前,3周前,6天前,15小时前,35分钟前
#region 时间转文本 public static string ToRead(this DateTime src) { return ToRead(src as DateTime?); } public static string ToRead(this DateTime? src) {原创 2014-11-13 11:27:57 · 1665 阅读 · 0 评论 -
C# ZIP 压缩解压操作
using System;using System.Collections.Generic;using ICSharpCode.SharpZipLib.Zip;using ICSharpCode.SharpZipLib.Core;namespace System.IO{ /// /// ZIP 压缩包处理工具 /// public static cl原创 2015-06-11 13:40:12 · 1085 阅读 · 0 评论 -
C# ChineseSpell.DLL 简体汉字转拼音
ChineseSpell.DLL主要函数调用:using System;using System.Collections.Generic;using System.Runtime.CompilerServices;namespace ChineseSpell{ // 摘要: // 汉字转拼音辅助类 public static class Chin原创 2015-06-04 11:21:59 · 1964 阅读 · 0 评论 -
C# 模拟 Http 请求
1.支持 Gzip 和 deflate 压缩方式的响应信息2.POST 可扩展提交文件3.可设置代理(未测试过)4.自动判断响应内容的字符集(简单判断,真实情况很复杂,有些无字符集描述的,或者 Response.Charset 是 ISO-**** 页面是 UTF-8 输出是 GBK ,环境很复杂,只能做到初步判断与转换)。原创 2015-04-23 01:36:59 · 1997 阅读 · 0 评论 -
C# OrderBy 扩展
public enum OrderByStatus { ASC, DESC } public static class OrderByHelper { public static IOrderedQueryable OrderIf(this IQueryable source, Expression> order,原创 2014-12-11 16:09:16 · 2083 阅读 · 0 评论 -
C# 枚举 Enum 工具类
using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;using System.Reflection;using System.Text;namespace EnumConsoleApplication1{ public static class原创 2014-10-11 17:37:40 · 1585 阅读 · 0 评论 -
C# NamedPipe 命名管道通信
异步操作类:原创 2014-10-30 15:50:28 · 5291 阅读 · 5 评论 -
正则表达式隐藏手机中间号码
示例: string number = "18512345678"; int length = 1; string result = number.HideMobileMiddleNumber(length, '*'); /* * length原创 2015-11-01 01:43:35 · 3353 阅读 · 0 评论