用C#发送邮件的几种方法
1 JavaScript发送邮件
<script language="javascript">
function SendMail() {
document.location = "mailto:seat@wicresoft.com;?subject=Feedback";
alert("ddd");
}
</script>
2 用Office发送邮件。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;
using Microsoft.Office.Interop.Outlook;
using Microsoft.Office;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
Microsoft.Office.Interop.Outlook.Application outlookObj = new Microsoft.Office.Interop.Outlook.Application();
MailItem Item = (Microsoft.Office.Interop.Outlook.MailItem)outlookObj.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
Item.To = "seat@info.com";
Item.CC = "seat@info.com";
Item.Subject = "hello";
Item.Body = "hello";
Item.Send();
}
}
但是,恼人的是,用这个方法发送的话,Outlook会产生一个对话框,提醒用户有未知的应用程序正在冒充她的名义发送邮件。
大家可以去试试。如果找到回避这个警告框的方法,请告诉我,谢.
相关文档:
1.添加命名空间引用
using System.Xml;
2.新建xml实例
public XmlDocument objXmlDoc = new XmlDocument();
3.加载Xml文档
string path=Server.Mappath("demo.xml");//得到文档路径
objXmlDoc.Load(path);//加载文档
4.查找要进行操作的结点
objXmlDoc.SelectNodes(xpath);//得到结点集合
objXmlDoc.SelectSingleN ......
接上一篇
删除原genre属性,删除leixing=love的所有结点。
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
<author>who</aut ......
DotNetBar正式版8.4.0.2,通过中国控件网采购。与试用版有明显的区别。主要是启动速度,正式版启动速度很快。另外有个问题提醒大家。
1、在工具栏中添加竖条,在DotNetBar中只需将需要添加这个竖条后面的控件的BeginGroup属性为true即可。
2、ComboBoxItem,使用。当DropDownStyle为DropDown时,不能在设计界面添加item否 ......
首先感谢CSDN的朋友laviewpbt为我给我的建议。
laviewpbt提出使用getpixel处理速度太慢,上不了档次。
这里我再给大家写两种处理速度更快的图形处理方式。
下面是个内存操作灰度的程序:
bmp = new Bitmap(Application.StartupPath + "\\1.jpg");
  ......
1、引用的空间:
using System.DirectoryServices;
using System.ServiceProcess;
2、调用
private void button1_Click(object sender, EventArgs e)
{
String webSiteName = "默认网站";
String pathToRoot = @"C:\Inetpub\wwwroot";
CreateWebSite(webSit ......