Code: Select all
using System;
using System.Linq;
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 Microsoft.WindowsMobile.Telephony;
namespace SmartDeviceProject1
{
public partial class Form1 : Form
{
Random rnd = new Random(DateTime.Now.Millisecond);
OutlookSession os = new OutlookSession();
ContactCollection kontakte;
public Form1()
{
InitializeComponent();
kontakte = os.Contacts.Items;
Contact meinKontakt = new Contact();
meinKontakt.FirstName = "Harry";
meinKontakt.LastName = "Potter";
meinKontakt.MobileTelephoneNumber = "123456678";
kontakte.Add(meinKontakt);
}
private void color_Click(object sender, EventArgs e)
{
this.BackColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
}
private void menuExit_Click(object sender, EventArgs e)
{
Close();
}
private void btnCall_Click(object sender, EventArgs e)
{
Phone meinHandy = new Phone();
meinHandy.Talk("12312312");
}
private void btnSMS_Click(object sender, EventArgs e)
{
SmsMessage mySms = new SmsMessage();
mySms.Body = "Call me after the meeting";
mySms.To.Add(new Recipient("45645645"));
mySms.Send();
MessageBox.Show("Sent");
}
}
}