08 2012 档案
摘要:在此,网站图片防盗链的方法是,通过获取Http请求头中的 Referer 标头与本网站域名比较,来判断用户是否来自本站跳转过来的创建一个全局处理程序,用来处理images目录下的图片的直接请求View Code 1 using System; 2 using System.Web; 3 4 /// 5 ///DaoLian 的摘要说明 6 /// 7 public class DaoLian:IHttpHandler 8 { 9 public bool IsReusable10 {11 get { return false; }12 }13 14...
阅读全文
摘要:当直接请求网站中images目录下的.jpg图片时把图片加上水印,然后输出1、在web.config中设置一个全局应用程序来处理该目录下的请求 <System.Web> <httpHandlers> <add verb="*" path="images/*.jpg" type="WaterMarker">2、创建一个处理水印的类,对应type中的WaterMarkerView Code 1 using System; 2 using System.Web; 3 using System.Drawin
阅读全文
摘要:在显示页面使用表单POST传送数据 <form action="TestUpload.ashx" method="post" enctype="multipart/form-data"> <input type="file" name="fUplod" /><input type="submit" value="上传" /> <span id="msgUpload"></span&g
阅读全文
摘要:1、邮件发送1.1、设置要发送的邮件对象 MailMessage mes=new MailMessage(); //发件人 mes.From=new MailAddress("caoyi@qq.com"); //收件人 mes.To.Add("hui@qq.com"); //标题 mes.Subject="标题"; //内容 mes.Body="内容"; //附件 mes.Attachments.Add(new Attachment(@"d:\aa.txt"));1.2、设置发送邮件服务器 设置
阅读全文
摘要:安装:CHSPinYinConv,导入CHSPinYinConv.dll,引入空间using Microsoft.International.Converters.PinYinConverter;View Code 1 //汉字转拼音 2 static string GetPinYin(string strCHS) 3 { 4 char[] myChar = strCHS.ToCharArray(); 5 string strOK = ""; 6 //遍历转换 7 ...
阅读全文

浙公网安备 33010602011771号