frm_addtel.cs

来自「Wince 上操作短信的实例」· CS 代码 · 共 45 行

CS
45
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Microsoft.WindowsMobile.PocketOutlook;
using System.Collections;

namespace winceSms
{
    public partial class frm_AddTel : Form
    {

        ContactCollection contacts;
        public frm_AddTel()
        {
            InitializeComponent();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            //添加电话薄
            OutlookSession session = new OutlookSession();
            contacts = session.Contacts.Items;
            Contact newTel = new Contact();
            newTel = contacts.AddNew();
            newTel.LastName = textBox1.Text.Substring(0, 1);
            newTel.FirstName = textBox1.Text.Substring(1, textBox1.Text.Length-1);
            
            newTel.MobileTelephoneNumber = textBox2.Text;
            newTel.HomeTelephoneNumber = textBox3.Text;
            newTel.BusinessTelephoneNumber = textBox4.Text;
            newTel.Update();
            this.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?