日期:2014-05-18 浏览次数:21116 次
        /// <summary>
        /// 亿美软通短信接口
        /// </summary>
        /// <param name="Receiver"></param>
        /// <param name="SmsBody"></param>
        /// <param name="UserID"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        [DllImport("EUCPComm.dll", EntryPoint = "SendSMS")]    //即时发送
        private static extern int SendSMS(string sn, string mn, string ct, string priority);
        [DllImport("EUCPComm.dll", EntryPoint = "SetKey")]
        private static extern int SetKey(string key);
        public static bool SendSmsByeMay(string Receiver, string SmsBody, string UserID, string Password,string Key)
        {
            if (SetKey(Key) == 1)
            { //Key正确
                if (SendSMS(UserID, Receiver, SmsBody, "5") == 1)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }