• 1
预览模式: 普通 | 列表
MailMessage mail = new MailMessage();
 mail.To 
= "me@163.com";
 mail.From 
= "you@163.com";
 mail.Subject 
= "this is a test email.";
 mail.Body 
= "Some text goes here";
 mail.Fields.Add(
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate""1"); //basic authentication
 mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername""AlleNny"); //set your username here
 mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword""Password"); //set your password here
 SmtpMail.SmtpServer = "smtp.163.com";  //your real server goes here
 SmtpMail.Send( mail );

Tags: smtpmail 认证 验证 .net

分类:.net | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 829

System.Configuration.ConfigurationSettings.AppSettings["XXX"]

如果你用这个方法来读取配置文件,并发生Configuration system failed to initialize错误。可以将配置文件中的appSettings和configSections调换一下位置。

 

分类:.net | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1396

将Visual Studio 恢复到初始状态

/resetuserdata 参数

我要与大家分享的最后一个技巧与 /resetuserdata 参数有关。如果 Visual Studio 在运行时被损坏,且无法从损坏状态进行恢复,您可以使用此参数将 Visual Studio 重置到其使用之初的状态。这些问题的例子可能包括:窗口布局文件被破坏、菜单自定义文件被破坏,或者键盘快捷方式文件被破坏。免责声明:如果使用此参数,您将丢失所有的环境设置和自定义设置。出于这个原因,Microsoft 不公开支持使用此参数,而且也没有将这个参数公之于众(如果在命令提示行中键入 devenv.exe /?,您不会看到显示此参数)。如果遇到环境方面的问题,应该将这个方法作为不得已而为之的办法,并且确保在使用此参数前,已通过导出环境设置对其进行了备份。

要使用此参数,请执行以下操作:

1.

查看更多...

Tags: Visual Studio 初始状态

分类:.net | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 878
  • 1