摘要:
public class ValidationCodeImageGenerator { //private string _charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; private string _charset = "1234567890"; //private string[] _fontNames = { "Verdana", "Microsoft Sans Serif", "Comic S 阅读全文
摘要:
public class CookieHelper : System.Web.SessionState.IReadOnlySessionState { public static void SetCookies(HttpContext context, string cookieName, Hashtable hashtable) { HttpCookie myCookie = new HttpCookie(cookieName); foreach (DictionaryEntry de in hashtable) { myCookie.Values.Remove(de.Key.ToStrin 阅读全文
摘要:
public static string GetRealIP(){ string result = String.Empty; result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (null == result || result == String.Empty) { result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } if (null == result 阅读全文
摘要:
using Excel = Microsoft.Office.Interop.Excel;private static Excel.Application m_xlApp = null;/// /// 将DataTable数据导出到Excel表 /// /// 要导出的DataTablepublic static void ExportExcel(System.Data.DataTable tmpDataTable) { if (tmpDataTable == null) { return; } long rowNum = tmpDataTable.Rows.Count;//行数... 阅读全文
摘要:
ASP示例:"" then returnstring=returnstring&"返回值:"&nodeobj.textend if response.write returnstring set nodeobj=nothing End Function%>或者function SendMessages(uid,pwd,tos,msg,otime)SoapRequest=""& _""& _""& _""& _"& 阅读全文
摘要:
asp示例:function getHTTPPage(strurl,data) on error resume next set http = Server.CreateObject("Msxml2.XMLHTTP") http.Open "POST",strurl, false http.setRequestHeader "Content-type:", "text/xml;charset=GB2312" Http.setRequestHeader "Content-Type", " 阅读全文
摘要:
// /// 发送邮件 /// /// 发件人邮箱 /// 发件人密码 /// 收件人邮箱 /// 主题 /// 内容 /// public static bool SendEmail(string fromemail, string pwd, string toemail, string subject, string body) { SmtpClient client = new SmtpClient(); client.Host = "smtp." + fromemail.Remove(0, fromemail.IndexOf("@") + 1); 阅读全文
摘要:
单线程示例:public delegate void SM();SM sm = new SM(() =>{ while (true) { //读取发短信列表 if(有数据) //发短信之后把短信标识改掉,防止重复发短信 else { //使用下一个时间间隔唤醒线程 System.Threading.Thread.Sleep(1000); //每秒读取一次 } } } sm.BeginInvoke(null, null);}多线程示例:pr... 阅读全文