随笔分类 -  asp.net

Jmail组件发送utf-8编码的邮件
摘要:用Jmail发送utf-8的邮件,在邮件服务提供商的web打开,邮件内容格式完全正常,可是从foxmail等客户端打开的时候,一直是乱码。困扰很久,今天终于解决了,记录一下,以便下次不犯同样的错误。 错误的写法: jmail.Charset="utf-8"jmail.EnableCharsetTranslation=true;jmail.ISOEncodeHeaders=falsejmail.ContentType="text/html" 后来找了很多资料,终于在jmail的官方网站(http://www.dimac.net/)上找到了解决办法。jmai 阅读全文
posted @ 2013-03-01 15:15 狐狸v
远程服务器返回错误(401)未经授权
摘要:没有权限 设置权限WebClient client=new WebClient();//NetworkCredential credentials = new NetworkCredential("名字", "密码");//client.Credentials = credentials;未能为 SSL/TLS 安全通道建立信任的解决办法最简单的办法是:1,先加入命名空间:using System.Net.Security;using System.Security.Authentication;using System.Security.Cryptog 阅读全文
posted @ 2013-03-01 15:14 狐狸v
LitJSON
摘要:官网http://litjson.sourceforge.net/http://sourceforge.net/projects/litjson/files/public class json{ /// <summary> /// 序列化 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static string objtojson(object obj) { ... 阅读全文
posted @ 2013-03-01 15:13 狐狸v
Log4Net
摘要:下载http://logging.apache.org/log4net/先在web.config中的<configuration>节点下添加如下配置:<configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /></configSections>在<configuration>节点下添加如下log4net节点配置:<log4net de 阅读全文
posted @ 2013-03-01 15:13 狐狸v