// 撥打電話 private void button7_Click(object sender, EventArgs e) { SkypeClass skype = new SkypeClass(); CommandClass cmd = new CommandClass(); skype._ISkypeEvents_Event_Command += new _ISkypeEvents_CommandEventHandler(skype__ISkypeEvents_Event_Command); cmd.Command = "OPEN IM " + "撥號";//打開Skype視窗; skype.SendCommand(cmd); cmd.Command = "CALL " + "撥號";//撥號 skype.SendCommand(cmd); }
//取消拨号 private void button8_Click(object sender, EventArgs e) { SkypeClass skype = new SkypeClass(); CommandClass cmd = new CommandClass(); cmd.Command = "SEARCH ACTIVECALLS";//搜尋ID skype.SendCommand(cmd); int id = skype.ActiveCalls[1].Id; cmd.Command = "SET CALL " + id + " STATUS FINISHED";//根據ID掛斷電話 skype.SendCommand(cmd); }
public static void HandOff() { CreateSkypeObject(); //SkypeClass skype = new SkypeClass(); CommandClass cmd = new CommandClass(); cmd.Command = "SEARCH ACTIVECALLS";//搜尋ID SkypeObj.SendCommand(cmd); int id = SkypeObj.ActiveCalls[1].Id; cmd.Command = "SET CALL " + id + " STATUS FINISHED";//根據ID掛斷電話 SkypeObj.SendCommand(cmd); }