2006年3月20日

摘要: /// /// 用户验证 /// ///ex:Session["userid"]=sjmain.US.smis.Functions.EncryptCookie(username.Value.Trim(),1); ///Session["userpwd"]=sjmain.US.smis.Functions.EncryptCookie(password.Value.Trim(),2); pub... 阅读全文
posted @ 2006-03-20 11:48 多铭 阅读(268) 评论(0) 推荐(0)
 
摘要: /// /// 加密字符串,使用不同加密方法 /// /// encrypting string /// format,0 is SHA1,1 is MD5 /// public static string Encrypt(string stringToEncrypt,int encryptMethod) { string str = ""; switch(encryp... 阅读全文
posted @ 2006-03-20 11:42 多铭 阅读(172) 评论(0) 推荐(0)
 
摘要: /// /// 加密 Cookie字符串 /// /// 需要加密的cookie字符串 /// /// 加密过的cookie字符串 public static string EncryptCookie(string cookie,int type) { string str = En(cookie,type); StringBuilder sb = new String... 阅读全文
posted @ 2006-03-20 11:40 多铭 阅读(216) 评论(0) 推荐(0)
 
摘要: /// /// 加密字符串 /// /// stringusing System.Web.Security; public static string Encrypt(string stringToEncrypt) { string str = ""; FormsAuthenticationTicket ticket = new System.Web.Security.For... 阅读全文
posted @ 2006-03-20 11:38 多铭 阅读(262) 评论(0) 推荐(0)

2006年3月19日

摘要: 1/**//// 2/// HTML encode 3/// 4/// string 5/// 6public static string Encode(string str) 7{ 8 str = str.Replace("&","&"); 9 str = str.Replace("'","''");10 str = str.Repla... 阅读全文
posted @ 2006-03-19 13:25 多铭 阅读(185) 评论(0) 推荐(0)