110,538
社区成员
发帖
与我相关
我的任务
分享
[DllImport("SMSDLL.dll")]
struct SMSReportStruct
{
uint index; //短消息编号:index,从0开始递增
[MarshalAs(UnmanagedType.ByValArray ,SizeConst=256)]
public char[] Msg; //短信内容
int Success; //是否发送成功 0为失败,非0为成功
[MarshalAs(UnmanagedType.ByValArray ,SizeConst=32)]
public char[] PhoneNo; //目标手机号码
}
struct SMSMessageStruct
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public char[] Msg; //短信内容
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public char[] PhoneNo; //对方手机号码
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public char[] ReceTime; //接收时间
}
[DllImport("c:\\SMSDLL.dll")]
protected static extern uint SMSSendMessage(string Msg,string PhoneNo);
[DllImport("c:\\SMSDLL.dll")]
protected static extern int SMSReport(ref SMSReportStruct rept);
[DllImport("c:\\SMSDLL.dll")]
protected static extern int SMSQuery(uint index);
[DllImport("c:\\SMSDLL.dll")]
protected static extern int SMSGetNextMessage(ref SMSMessageStruct Msg);
[DllImport("c:\\SMSDLL.dll")]
protected static extern int SMSGetLastError(string err);