首先到网上下载MySql.Data.MySqlClient.dll,然后添加引用到项目 using MySql.Data.MySqlClient; string connectSt…
public void ungzip(string path, string decomPath, bool overwrite) { //for overwriting purp…
using System; using System.IO; using System.IO.Compression; using System.Runtime.Serializa…
using System; using System.Text.RegularExpressions; using System.Text; namespace Ming { pu…
C#封装的Sqlite访问类,要访问Sqlite这下简单了,直接调用此类中的方法即可 using System; using System.Collections; using S…
JSON与XML的比较 ◆可读性 JSON和XML的可读性相比较而言,由于XML提供辅助的标签,更加适合人阅读和理解。 ◆文件大小与传输 XML允许使用方便的标签,所以文件尺寸是要…
C#实现的访盗链的FileHandler /// <summary> /// 访盗链的FileHandler /// </summary> public c…
C#下载网页,即使网页404或者500错误 public static string GetWebPageAsString(string url) { HttpWebRequest…
C#提高随机数不重复概率的种子生成方法 static int GetRandomSeed( ) { byte[] bytes = new byte[4]; System.Secur…
C#在服务器端裁剪图片代码 //图片路径 String oldPath = Server.MapPath("~/62223231.jpg"); //新图片路径 …
异步发送电子邮件代码 /// <summary> /// 异步发送电子邮件 /// </summary> /// <param name="…
C#查找字符串的所有排列组合 // 1. remove first char // 2. find permutations of the rest of chars // 3. …