摘要: //POST数据 public static string PostData(string url, string data) { WebClient wc = new WebClient(); wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); byte[] postData = Encoding.Default.GetBytes(data); byte[] responseData = wc.UploadData(url, "POST", pos 阅读全文
posted @ 2012-10-06 09:44 八星瓢虫 阅读(215) 评论(0) 推荐(0)
摘要: public static string noHtml(string str) { if (str != null) { str = Regex.Replace(str, @"<script[^>]*>[\s\S]*?</script>", "", RegexOptions.IgnoreCase);//删除脚本 str = Regex.Replace(str, @"(<style)+[^<>]*>[^\0]*(<\/style>)+", "", Re 阅读全文
posted @ 2012-10-06 09:09 八星瓢虫 阅读(646) 评论(0) 推荐(0)
摘要: 命名空间添加引用using System.Net;using System.Net.Mail;//以下代码已经测试通过,我这里使用了QQ邮箱,需要在QQ邮箱中开启smtp。//参数说明(接收邮箱,标题,内容) public static void sendMail(string strTo, string strSubject, string strBody) { string strSmtpServer = "smtp.qq.com"; string strFrom = "你的QQ号码@qq.com"; string strFromPass = &qu 阅读全文
posted @ 2012-10-06 08:58 八星瓢虫 阅读(145) 评论(0) 推荐(0)