摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace TravelB2B.Core.Utils.Text 6 { 7 public class GetInitial 8 { 9 #region --获取联系人姓名的首字母 10 11 /// <summary> 12 /// 获取 阅读全文
posted @ 2019-09-23 22:03 醉酒三分醒 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace TravelB2B.Core.Utils.Text 6 { 7 /// <summary> 8 /// 产生随机中文验证码 9 /// </summary> 10 public class ChineseCode 11 { 1 阅读全文
posted @ 2019-09-23 22:01 醉酒三分醒 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1 #region 序列化 2 public static string Serializer<T>(T t) 3 { 4 //StringBuilder sb = new StringBuilder(); 5 using (MemoryStream ms = new MemoryStream()) 6 { 7 using (System.Xml.XmlTextWriter xw = new Sy 阅读全文
posted @ 2019-09-23 22:00 醉酒三分醒 阅读(174) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using org.in2bits.MyXls; namespace TravelB2B.Core.Utils.Excel { public class E... 阅读全文
posted @ 2019-09-23 21:59 醉酒三分醒 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.IO; 3 using System.Text; 4 using System.Text.RegularExpressions; 5 using System.Runtime.Serialization.Json; 6 using Newtonsoft.Json; 7 using System.Collections.Generic; 阅读全文
posted @ 2019-09-23 21:59 醉酒三分醒 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #region 获取文件后缀 public static string GetExtendName(string filename) { if (!string.IsNullOrEmpty(filename)) { var index = filename.LastIndexOf("."); if (index >= 0) return filename.Substring(index); } r 阅读全文
posted @ 2019-09-23 21:51 醉酒三分醒 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1 public class TimeHelper 2 { 3 #region 实现发表的时间显示 4 /// <summary> 5 /// 实现发表的时间显示为几个月,几天前,几小时前,几分钟前,或几秒前 6 /// </summary> 7 /// <param name="time"></param> 8 /// <returns></returns> 9 public static st 阅读全文
posted @ 2019-09-23 21:25 醉酒三分醒 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1 public class RequestResult 2 { 3 public bool IsSuccess { get; set; } 4 5 public string Message { get; set; } 6 7 public void OnSuccess(String msg = null) 8 { 9 IsSuccess = true; 10 Message = msg; 11 阅读全文
posted @ 2019-09-23 21:23 醉酒三分醒 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 身份证帮助类 3 /// 4 public class IDCardHelper 5 { 6 #region 检测身份证的合法性 7 public static bool Check(string cardId) 8 { 9 st... 阅读全文
posted @ 2019-09-23 21:20 醉酒三分醒 阅读(386) 评论(0) 推荐(0) 编辑
摘要: //string url = "https://www.baidu.com"; //string data = "client_id=21768513&client_secret=5568ab8e4f17b1a91bc732b289933f7d&grant_type=authorization_co 阅读全文
posted @ 2019-09-23 21:19 醉酒三分醒 阅读(767) 评论(0) 推荐(0) 编辑
摘要: #region 发送邮件 public bool Send(string email, string title, string body) { string message="发送成功"; return Send(email, title, body, out message); } public bool Send(string email, string title, string body 阅读全文
posted @ 2019-09-23 21:09 醉酒三分醒 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 1 public class Des 2 { 3 public static string Encrypt(string message, string key) 4 { 5 DES des = new DESCryptoServiceProvider(); 6 des.Key = Encoding.UTF8.GetBytes(key); 7 des.IV = Encoding.UTF8.GetB 阅读全文
posted @ 2019-09-23 21:07 醉酒三分醒 阅读(1240) 评论(0) 推荐(0) 编辑
摘要: #region 计算星期几 /// /// //: 星期日至星期六的值为0-6 /// /// /// /// /// public static int GetWeeksOfDate(int year, int mon... 阅读全文
posted @ 2019-09-23 21:05 醉酒三分醒 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 1 #region 生成随机字符 2 /// <summary> 3 /// 生成随机字符 4 /// </summary> 5 /// <param name="lens">随机字符长度</param> 6 /// <returns>随机字符</returns> 7 private static string RandomString(int lens) 8 { 9 char[] CharArr 阅读全文
posted @ 2019-09-23 20:58 醉酒三分醒 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1 #region MD5函数 2 /// 3 /// MD5函数 4 /// 5 /// 原始字符串 6 /// MD5结果 7 public static string MD5(string str) 8 { 9 byte[] b =... 阅读全文
posted @ 2019-09-23 20:51 醉酒三分醒 阅读(773) 评论(0) 推荐(0) 编辑
摘要: 1 #region 从字符串的指定位置截取指定长度的子字符串 2 /// 3 /// 从字符串的指定位置截取指定长度的子字符串 4 /// 5 /// 原字符串 6 /// 子字符串的起始位置 7 /// 子字符串的长度 8 /// 子字符串 9 ... 阅读全文
posted @ 2019-09-23 20:43 醉酒三分醒 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 1 public class AESEncryption 2 { 3 #region 加密 4 /// 5 /// 加密 6 /// 7 /// 需要加密的字符串 8 /// 向量 9 /// 密钥 10 /// 加密后base64... 阅读全文
posted @ 2019-09-23 20:41 醉酒三分醒 阅读(730) 评论(0) 推荐(0) 编辑
摘要: 视图: JS: 控制器:(用于初始化时间) 也可以参考博客:https://www.cnblogs.com/javaboy2018/p/9313433.htmlhttps://www.cnblogs.com/goloving/p/7163697.html 阅读全文
posted @ 2019-09-23 20:31 醉酒三分醒 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 控制器: 首次保存: 再次修改时: 阅读全文
posted @ 2019-09-23 20:05 醉酒三分醒 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 视图内容: CSS: JS部分: 控制器: 阅读全文
posted @ 2019-09-23 16:47 醉酒三分醒 阅读(207) 评论(0) 推荐(0) 编辑