摘要: public static class DbOperation { private static string connStr = "Data Source=127.0.0.1;Initial Catalog=wk;Persist Security Info=True;User ID=sa;Password=123"; public static string DbQueryCount(string cmdStr) { string result = ""; SqlConnection conn = n... 阅读全文
posted @ 2013-12-26 10:36 美丽的矩阵 阅读(248) 评论(0) 推荐(0) 编辑
摘要: public class FtpOperation { public static void UploadFile(FileInfo fileinfo, string targetDir, string hostname, string username, string password, string reName) { //1. check target string target; if (targetDir.Trim() == "") { ... 阅读全文
posted @ 2013-12-26 10:34 美丽的矩阵 阅读(252) 评论(0) 推荐(0) 编辑
摘要: public static string GetMD5HashFromFile(string fileName) { try { FileStream file = new FileStream(fileName, FileMode.Open); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); b... 阅读全文
posted @ 2013-12-26 10:33 美丽的矩阵 阅读(221) 评论(0) 推荐(0) 编辑
摘要: private string GetMD5str(string oldStr) { //将输入转换为ASCII 字符编码 ASCIIEncoding enc = new ASCIIEncoding(); //将字符串转换为字节数组 byte[] buffer = enc.GetBytes(oldStr); //创建MD5实例 MD5 md5 = new MD5CryptoServiceProvider(); //进行MD5加密 ... 阅读全文
posted @ 2013-12-26 10:30 美丽的矩阵 阅读(623) 评论(0) 推荐(0) 编辑