摘要: 下面的代理已经调试过,用的是163的SMTPusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Net.Mail;using System.Text;using System.Net;namespace Test.Email{ public partial class TestEmail : System.Web.UI.Page { protected vo 阅读全文
posted @ 2013-08-13 17:01 永不言败,自信相伴 阅读(175) 评论(0) 推荐(0) 编辑
摘要: /// /// 清楚HTML中的特殊字符 /// /// /// public static string DelHTML(string Htmlstring) { if (string.IsNullOrEmpty(Htmlstring)) return ""; //特殊的字符 Htmlstring = Htmlstring.Replace("&", ""); Htmlstring = Htmlstring.Replace("", ""); Htmlstring = Htmlstring 阅读全文
posted @ 2013-08-12 17:18 永不言败,自信相伴 阅读(482) 评论(0) 推荐(0) 编辑
摘要: #region 将Html特殊字符转义处理 /// /// 将Html特殊字符转义处理 /// /// 需要专业的内容 /// public static string HtmlCode(string strHC) { string strR = string.Empty; if (string.IsNullOrEmpty(strHC)) return ""; strR = strHC.Replace("&", "&"); strR = strR.Replace(">", " 阅读全文
posted @ 2013-08-12 17:17 永不言败,自信相伴 阅读(1130) 评论(0) 推荐(0) 编辑
摘要: /// /// 截取字符窜 /// /// 待截取字符串 /// 截取字符串长度 /// public static string GetSubString(string p_SrcString, int p_Length) { string myResult = p_SrcString; if (p_Length >= 0) { byte[] bsSrcString = System.Text.Encoding.GetEncoding("GB2312").GetBytes(p_SrcString); if (bsSrcString.Length > p_Len 阅读全文
posted @ 2013-08-12 17:16 永不言败,自信相伴 阅读(251) 评论(0) 推荐(0) 编辑
摘要: /// /// 截取需要的字符串(非字节处理) /// /// 需要截取的字符串 /// 截取长度 /// 被截取的字符串结尾追加符 /// public string GetSubString(string inputStr, int len, string ss = "") { if (inputStr.Length < len) return inputStr; return inputStr.Substring(len) + ss; } 阅读全文
posted @ 2013-08-12 17:15 永不言败,自信相伴 阅读(183) 评论(0) 推荐(0) 编辑
摘要: #region 时间格式转换为yyyy-mm-dd hh:mm:ss.fff /// /// 时间格式转换为yyyy-mm-dd hh:mm:ss.fff /// /// /// public static string ConvertDateTime(object obj) { if (obj != null && !string.IsNullOrEmpty(obj.ToString())) { try { return ((System.DateTime)(obj)).ToString("yyyy-MM-dd HH:mm:ss.fff"); } catc 阅读全文
posted @ 2013-08-12 16:43 永不言败,自信相伴 阅读(545) 评论(0) 推荐(0) 编辑
摘要: #region 时间戳转为时间 /// /// 时间戳转为时间 /// /// /// public static DateTime GetTime(string stringTime) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(stringTime + "0000000"); TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow 阅读全文
posted @ 2013-08-12 16:42 永不言败,自信相伴 阅读(186) 评论(0) 推荐(0) 编辑
摘要: #region 去除HTML标记 /// /// 去除HTML标记 /// /// 包括HTML的源码 /// 已经去除后的文字 public static string NoHTML(string Htmlstring) { //删除脚本 Htmlstring = Regex.Replace(Htmlstring, @"", "", RegexOptions.IgnoreCase); //删除HTML Htmlstring = Regex.Replace(Htmlstring, @"]*)>", "", R 阅读全文
posted @ 2013-08-12 16:40 永不言败,自信相伴 阅读(246) 评论(0) 推荐(0) 编辑
摘要: /// /// /// 待加密字串 /// 加密后的字串 public static string MD5Encrypt(string strSource) { return MD5Encrypt(strSource, 32); } /// /// /// 待加密字串 /// 16或32值之一,其它则采用.net默认MD5加密算法 /// 加密后的字串 public static string MD5Encrypt(string strSource, int length) { byte[] bytes = Encoding.ASCII.GetBytes(strSo... 阅读全文
posted @ 2013-08-12 16:39 永不言败,自信相伴 阅读(853) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.Serialization.Json;using System.IO;using System.Data;using System.ComponentModel;using System.Web.UI.WebControls;namespace SieCom.YQ.Common{ public class CommondLibray { pu 阅读全文
posted @ 2013-08-12 16:37 永不言败,自信相伴 阅读(465) 评论(0) 推荐(0) 编辑