日期:2014-05-17  浏览次数:21131 次

C#如何判断短信猫来电。(就是接到电话)
大神来啊 。

------解决方案--------------------
短信猫有提供这个方法么...
看接口资料吧
------解决方案--------------------
探讨
请问C#如何判断是爱国者导弹击中了米格29战机的副油箱还是被歼10的主机炮打中了尾翼?
哪位大神知道?跪求!

------解决方案--------------------
探讨
引用:
请问C#如何判断是爱国者导弹击中了米格29战机的副油箱还是被歼10的主机炮打中了尾翼?
哪位大神知道?跪求!


别捣乱。我知道你的意思是说C#做不到这些。实际上不是做不到,而是:只要你的传感器给我开放了相应的API、SDK或者适当的接口,我就能用C#做到你说的这个功能。

请看这本书:
《Microsoft .NET Micro Framework嵌入式编……

------解决方案--------------------
关于C#判断短信猫的来电,我没有做过短信猫的项目,但是我在Windows Mobile手机上做过自动拨打电话、自动拦截电话、自动记录电话的通话质量、自动记录拨打电话的过程中系统内部各种相关的事件和log的自动化压力测试工具。

下面是节选的其中的一个类,或许对你能有启发:

在Windows Mobile上监听Radio Interface Layer Notification 
http://blog.csdn.net/xinyaping/article/details/5904307

RIL(Radio Interface Layer)工作在手机的底层,负责数据传输、AT指令的发送、接收及解析、提供网络支持,支持上层通讯应用程序的SMS、Voice Call等。可以说,RIL是手机通信系统的软件层面的最底层。

如果我们想监听手机上的通讯活动,比如说想记录用户什么时候给那个号码拨打了电话,什么时候开始呼叫,什么时候开始建立会话进行通话,什么时候挂的电话(谁挂的),以及更详细一点的信息,例如手机都通过了哪些基站……这些信息都可以拦截RIL层的消息来得到。

本程序就是一个例子。当然,只是个示范程序,实现了最基本的监听,想要得到进一步详细的信息,只需对监听来的消息进行进一步解析即可。

C# code

//---------------------------------------   
// <copyright file="RILHelper.cs" company="Yaping Xin">   
//     Copyright (c) Yaping Xin. All rights reserved.   
// </copyright>   
// <Description>Helper class for Radio Interface Layer.</Description>   
//---------------------------------------   
namespace MobileAutomation.Projects.VDFStressTesting   
{   
    using System;   
    using System.Runtime.InteropServices;   
    using System.Threading;   
   
    /// <summary>   
    /// Helper class for Radio Interface Layer.   
    /// </summary>   
    public class RILHelper   
    {   
       /// <summary>   
       /// Delegation definition of Log event handler   
       /// </summary>   
       /// <param name="message">Message to transfer</param>   
       public delegate void LogHandler(string message);   
   
       /// <summary>Event handler to record log</summary>   
       public static event LogHandler Log;   
   
       /// <summary>AutoResetEvent object</summary>   
       private static AutoResetEvent waithandle = new AutoResetEvent(false);   
          
       /// <summary>HRESULT to RIL object</summary>   
       private static IntPtr hRil = IntPtr.Zero;   
   
       /// <summary>HRESULT to result</summary>   
       private static IntPtr hRes = IntPtr.Zero;   
          
       /// <summary>   
       /// RILRESULTCALLBACK delegation   
       /// http://msdn.microsoft.com/en-us/library/aa920069.aspx   
       /// </summary>   
       /// <param name="dwCode">Specifies the result code.</param>   
       /// <param name="hrCmdID">ID returned by the command that originated this response.</param>   
       /// <param name="lpData">Data associated with the notification.</param>   
       /// <param name="cbData">Size of the structure pointed to by lpData.</param>   
       /// <param name="dwParam">Specifies the parameter passed to RIL_Initialize  or RIL_InitializeEmergency.</param>   
       public delegate void RILRESULTCALLBACK(   
           uint dwCode,   
           IntPtr hrCmdID,   
           IntPtr lpData,   
           uint cbData,   
           uint dwParam);   
   
       /// <summary>   
       /// RILNOTIFYCALLBACK delegation   
       /// http://msdn.microsoft.com/en-us/library/aa922465.aspx   
       /// </summary>   
       /// <param name="dwCode">Specifies the