namespace Comer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void ListenCall()
{
SystemState callState = new SystemState(SystemProperty.PhoneCallTalking);
SystemState callCount = new SystemState(SystemProperty.PhoneActiveCallCount);
callState.Changed += new ChangeEventHandler(callState_Changed);
callCount.Changed += new ChangeEventHandler(callCount_Changed);
} public void callCount_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null && (int)args.NewValue != 0)
MessageBox.Show("Call Incoming");
} public void callState_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null)
{
String state = ((int)args.NewValue) == 1 ? "talking" : "hang up";
MessageBox.Show(state);
}
}
}
}
帮我看一下那有错误啊(能生成)怎么测试时不反应啊。。
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void ListenCall()
{
SystemState callState = new SystemState(SystemProperty.PhoneCallTalking);
SystemState callCount = new SystemState(SystemProperty.PhoneActiveCallCount);
callState.Changed += new ChangeEventHandler(callState_Changed);
callCount.Changed += new ChangeEventHandler(callCount_Changed);
} public void callCount_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null && (int)args.NewValue != 0)
MessageBox.Show("Call Incoming");
} public void callState_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null)
{
String state = ((int)args.NewValue) == 1 ? "talking" : "hang up";
MessageBox.Show(state);
}
}
}
}
帮我看一下那有错误啊(能生成)怎么测试时不反应啊。。
解决方案 »
- 关于运算符优先级的问题
- 如何用Winform做一个识别图片的程序
- G3传真文件的怎样打开,有什么工具可以使用,或者用c#实现打开?
- 两个DataTable的合并问题
- C#.net 调用Dll 参数传递问题
- 怎么实现这样的一个textbox?
- 球面贴图的问题:如何在圆球上贴文字,产生立体效果,不要OpenGL,DirectX的,要的是C++ Or C#算法。
- c#如何实现在web上绘图?
- 请问如何使用session来保存用户的登陆名
- 在AxWebBrowser1中打开Word文档??????(急!!!!!!!!!!)
- winform 获取网页代码
- CSDN 最近登陆怎么这么慢? 用的搜狗浏览器就打不开很多时候。 早上换了个chrome感觉就可以打开了
{
InitializeComponent();
ListenCall()
}