首页 新闻 会员 周边

关于上海移动企信通的empp.dll的Com组件导致IIS“Service Unavailable”

0
悬赏园豆:50 [已解决问题] 解决于 2013-01-18 18:05
//连接短信发送服务器
            emptcl empp = new emptclClass();
            ConnectResultEnum result = empp.connect(host, port, accountId, password);
            if (empp == null || !empp.connected)
            {
                return "连接失败";
            }

            ShortMessage shortMsg = new ShortMessageClass();
            shortMsg.srcID = accountId;  //获取发送短信者ID 
            shortMsg.needStatus = true; //获取是否返回状态报告标志

            Mobiles mob = new MobilesClass();
            string[] sendMobiles = mobiles.Trim('|').Split('|');
            foreach (string sendMobile in sendMobiles)
            {
                mob.Add(sendMobile);
            }

            shortMsg.DestMobiles = mob;  //发送的手机号
            shortMsg.content = contents;   //短信内容
            shortMsg.SendNow = true;       //设置是否立即发送短信标志

            //发送短信
            empp.submit(shortMsg);

            //对象用于实现发送短信后,接受到的返回信息的处理
            SubmitResp submitResp = new SubmitRespClass();
            int doResult = -1;
            Int32.TryParse(submitResp.Result.ToString(), out doResult);
            if (doResult == 0)
            {
                mob.RemoveAll(); 
                return "成功";
            }
            else
            { 
                return "失败";
            }

            empp.disconnect();

上面就是主要的代码,写在了一个Webservice里面,平均5天左右就会导致服务挂掉,求大神指教!

惜寒的主页 惜寒 | 初学一级 | 园豆:63
提问于:2013-01-14 10:54
< >
分享
最佳答案
0

设置一下进程池 2天自动回收一下 这个是因为内存泄漏!

收获园豆:50
xluo | 初学一级 |园豆:94 | 2013-01-14 12:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册