首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

利用短信远道关闭计算机

2012-08-03 
利用短信远程关闭计算机请问:GMS.GSMModemGetDevice()的命名空间是什么?如何实现用短信远程关闭计算机?[

利用短信远程关闭计算机
请问:
GMS.GSMModemGetDevice();的命名空间是什么?
如何实现用短信远程关闭计算机?

[解决办法]
(2)GSMModemGetDevice函数

该函数获取当前的通讯端口,代码如下:

[DllImport("dllforvc.dll",

EntryPoint = "GSMModemGetDevice",

CharSet = CharSet.Ansi,

CallingConvention = CallingConvention.StdCall)]

public static extern string GSMModemGetDevice();


[解决办法]
如何实现用短信远程关闭计算机?

判断短信里的关键字来调用 progress shut down命令来关机
[解决办法]
class GMS 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemInitNew", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern bool GSMModemInitNew( 
string device, 
string baudrate, 
string initstring, 
string charset, 
bool swHandshake, 
string sn); 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemGetSnInfoNew", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern string GSMModemGetSnInfoNew(string device, string baudrate); 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemGetDevice", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern string GSMModemGetDevice(); 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemGetBaudrate", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern string GSMModemGetBaudrate(); 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemRelease", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern void GSMModemRelease(); 

[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemGetErrorMsg", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern string GSMModemGetErrorMsg(); 
[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemSMSsend", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern bool GSMModemSMSsend( 
string serviceCenterAddress, 
int encodeval, 
string text, 
int textlen, 
string phonenumber, 
bool requestStatusReport); 
[DllImport("dllforvc.dll", 
EntryPoint = "GSMModemSMSReadAll", 
CharSet = CharSet.Ansi, 
CallingConvention = CallingConvention.StdCall)] 
public static extern string GSMModemSMSReadAll(int RD_opt); 

参考

热点排行