我OA里用的是移动的接口,它的原理好像也是加到队列里,间隔时间检查发送的
有两个DLL:ImApiDotNet.dll 和 libmySQL.dll
-
C# code
-
private static int sendMobileMessage( string [] mobiles, string msgText) { int sysState = 0 ; ImApiDotNet.APIClient smsObj = new ImApiDotNet.APIClient(); int initState = smsObj.init( " IP地址 " , " 用户名 " , " 密码 " , " API的code " , " 数据库名 " ); if (initState == 0 ) { if (smsObj.sendSM(mobiles,msgText, null , 0 , 0 ) == 0 ) { sysState = 1 ; // 发送成功 } else { sysState = 0 ; // 发送失败 } } else { sysState =- 1 ; // 初使化失败 // Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("手机短信发送失败:原因:["+initLot[initState]+"],"); } return sysState; }