在.Net使用电话API
仍然需要调用非托管代码实现。
读取SMS的内容MSDN上有:
http://www.microsoft.com/china/MSDN/library/archives/library/dnppc2k2/html/sim_programming.asp
<System.Runtime.InteropServices.DllImport("phone.dll")> _
Private Shared Function PhoneMakeCall(ByRef ppmci As
PhoneMakeCallInfo) As IntPtr
End Function
PhoneNumber.Insert(PhoneNumber.Length, " ")
Dim cPhoneNumber() As Char = PhoneNumber.ToCharArray()
Dim pAddr() As Char = cPhoneNumber
Dim info As PhoneMakeCallInfo = New PhoneMakeCallInfo
info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info)
Dim iPhoneNumber As IntPtr = Marshal.AllocHLocal(cPhoneNumber.Length)
System.Runtime.InteropServices.Marshal.Copy(cPhoneNumber, 0,
iPhoneNumber, cPhoneNumber.Length)
info.pszDestAddress = iPhoneNumber
Private Shared Function PhoneMakeCall(ByRef ppmci As
PhoneMakeCallInfo) As IntPtr
End Function
PhoneNumber.Insert(PhoneNumber.Length, " ")
Dim cPhoneNumber() As Char = PhoneNumber.ToCharArray()
Dim pAddr() As Char = cPhoneNumber
Dim info As PhoneMakeCallInfo = New PhoneMakeCallInfo
info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info)
Dim iPhoneNumber As IntPtr = Marshal.AllocHLocal(cPhoneNumber.Length)
System.Runtime.InteropServices.Marshal.Copy(cPhoneNumber, 0,
iPhoneNumber, cPhoneNumber.Length)
info.pszDestAddress = iPhoneNumber
读取SMS的内容MSDN上有:
http://www.microsoft.com/china/MSDN/library/archives/library/dnppc2k2/html/sim_programming.asp