日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

怎樣在 C# 中發(fā)起會(huì)議之類的特殊郵件_.Net教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:淺析微軟 ASP.NET 環(huán)境下的頁面驗(yàn)證控件
驗(yàn)證控件用于驗(yàn)證用戶的輸入,利用這些控件,開發(fā)人員可以輕松的實(shí)現(xiàn)對(duì)用戶輸入的驗(yàn)證。ASP.NET提供了六種驗(yàn)證控件。 1.Required Field Validator:驗(yàn)證輸入是否為空的控件。 主要屬性: Control To Validate:表示要進(jìn)行檢查的控件ID。此屬性必須設(shè)置為輸入

從C#中調(diào)用Outlook中的API,可以發(fā)起會(huì)議之類的特殊郵件。方法如下:

創(chuàng)建項(xiàng)目后,為它添加.NET引用:“Microsoft.Office.Interop.Outlook“的引用,即可調(diào)用,需要注意的是,在添加的時(shí)候,注意一下Office版本號(hào)。

在調(diào)用其API發(fā)起會(huì)議的過程中,遇到了一個(gè)問題:

創(chuàng)建完一個(gè)約會(huì)條目后,找了很久沒找到如何為這一約會(huì)指定“發(fā)件人”,后來一想,Window CF 中,查找人員信息有個(gè)OutlookSession的東東,

那這Outlook會(huì)不會(huì)有同樣的方式呢,經(jīng)過測(cè)試,還真的找到方法,原來,它的API指定的發(fā)件人是和你機(jī)上運(yùn)行的Outlook的帳戶設(shè)置直接相關(guān)的。

通過 ApplicationClass.Session.Accounts即可找到您設(shè)置的帳戶集合,需要特別特別注意的是,在這里,取某個(gè)人員時(shí),集合的索引是從1開始,而不是

從0開始。 找到相關(guān)的帳戶后,可以通過 AppointmentItem.SendUsingAccount 屬性來指定約會(huì)的發(fā)件人。

下面是測(cè)試的代碼,在WIN2003+OFFICE12下運(yùn)行通過,成功創(chuàng)建會(huì)議:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Outlook;
/**/////////////////////
/**//* 調(diào)用Outlook api 發(fā)起會(huì)議
/* [email protected]
////////////////////
namespace OutlookAPI
{
   class Program
    {
       static void Main(string[] args)
       {
            try
            {
                ApplicationClass oApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
                //會(huì)議是約會(huì)的一種
                AppointmentItem oItem = (AppointmentItem)oApp.CreateItem(OlItemType.olAppointmentItem);
                oItem.MeetingStatus = OlMeetingStatus.olMeeting;
                oItem.Subject = "主題";
                oItem.Body = "內(nèi)容";
                oItem.Location = "地點(diǎn)";
                //開始時(shí)間 
                oItem.Start = DateTime.Now.AddDays(1);
                //結(jié)束時(shí)間
                oItem.End = DateTime.Now.AddDays(2);
                //提醒設(shè)置
                oItem.ReminderSet = true;
                oItem.ReminderMinutesBeforeStart = 5;
                //是否全天事件
                oItem.AllDayEvent = false;
                oItem.BusyStatus = OlBusyStatus.olBusy;               
                //索引從1開始,而不是從0
                //發(fā)件人的帳號(hào)信息
                oItem.SendUsingAccount = oApp.Session.Accounts[2];              
                //添加必選人
                Recipient force = oItem.Recipients.Add("[email protected]");
                force.Type = (int)OlMeetingRecipientType.olRequired;
                //添加可選人
                Recipient opt = oItem.Recipients.Add("[email protected]");
                opt.Type = (int)OlMeetingRecipientType.olOptional;
                //添加會(huì)議發(fā)起者
                Recipient sender = oItem.Recipients.Add("[email protected]");
                sender.Type = (int)OlMeetingRecipientType.olOrganizer;                
                oItem.Recipients.ResolveAll();
                //oItem.SaveAs("d:/TEST.MSG", OlSaveAsType.olMSG);
                oItem.Send();
                //MailItem mItem = (MailItem)oApp.CreateItem(OlItemType.olMailItem);
                //Recipient rTo = mItem.Recipients.Add("****");
                //rTo.Type = (int)OlMailRecipientType.olTo;
                //Recipient rCC=mItem.Recipients.Add("****");
                //rCC.Type = (int)OlMailRecipientType.olCC;
                //Recipient rBC = mItem.Recipients.Add("****");
                //rBC.Type = (int)OlMailRecipientType.olBCC;

               Console.WriteLine("OK");
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
    }
}

分享:解析.Net基礎(chǔ):C#中對(duì)DatagridView部分常用操作
0(最基本的技巧)、獲取某列中的某行(某單元格)中的內(nèi)容 this.currentposition = this.dataGridView1.BindingContext [this.dataGridView1.DataSource, this.dataGridView1.DataMember].Position; bookContent = this.database.dataSet.Tables[0].Rows [this.

來源:模板無憂//所屬分類:.Net教程/更新時(shí)間:2009-08-27
相關(guān).Net教程