有谁做过金笛的短信猫不知道C#怎么调用OCX控件,各位帮忙,,,,感激
JindiSMSControl.ocx //这个怎么用c#调用里面的方法
MSCOMM32.OCX我通过导入Com组件然后
JindiSMSControl jd = new JindiSMSControlClass();
报错
错误 1 类型“JDSMSCtrl.JindiSMSControlClass”未定义构造函数 E:\Project\SMS\WindowsSMSService\SMSService.cs 33 34 WindowsSMSService

解决方案 »

  1.   

    那个ocx爆难用,直接调dll!这个东西稀烂= =,给我的光盘居然还带毒....简直无敌了
      

  2.   

    LYSmsService.msi 装起,然后调用dll处理哈
      

  3.   

    using System;
    using System.Collections.Generic;
    using System.Text;using XTTSMSCOMLib;namespace WebServiceUserWatcher
    {
        public class MsgSender
        {
            private ModemServiceClass m_msgService;        private object sendCount;
            private string m_LastMsgCode;        public string ConnectState = "";        public delegate void StateChangeHandler(string info);        public event StateChangeHandler DeviceStateChanged;
            public MsgSender(string comport, string compara, StateChangeHandler stateChange)
            {
                sendCount = new object();
                m_msgService = new ModemServiceClass();
                m_msgService.ConnectModemResult += new _IModemServiceEvents_ConnectModemResultEventHandler(p_ConnectResult);
                m_msgService.SimCardNoMemory += new _IModemServiceEvents_SimCardNoMemoryEventHandler(CleanSimCard);
                m_msgService.WorkMode = EMobileWorkMode.ASYNCHRONOUS_WORKMODE;
                this.DeviceStateChanged += new StateChangeHandler(stateChange);
                ConnectModem(comport,compara);        }        public void ConnectModem(string comport, string compara)
            {            EMobileCommPort port = (EMobileCommPort)Enum.Parse(typeof(EMobileCommPort), comport);
                EMobileCommPara com = (EMobileCommPara)Enum.Parse(typeof(EMobileCommPara), compara);
                m_msgService.ConnectModem(port, com);
            }        public void DisConnectDevice()
            {
                m_msgService.DisConnectModem();
            }        private void CleanSimCard()
            {
                m_msgService.ClearSimMsg();
            }
            private void p_ConnectResult(EMobileModemStatus state)
            {
                if (DeviceStateChanged != null)
                {
                    this.ConnectState = state.ToString();
                    DeviceStateChanged(this.ConnectState);
                }        }        public bool SendMsg(string msgContent, string phoneNumber)
            {
                bool result = false;
                try
                {
                    m_LastMsgCode = System.Guid.NewGuid().ToString();                m_msgService.SendMsg(m_LastMsgCode, phoneNumber, msgContent, out (object)sendCount, EMobileMsgType.TEXTSMS_MSGTYPE, "", 16, false, false);                result = true;
                }
                catch(Exception err)
                {
                    throw err;
                }            return result;
            }
        }
    }
      

  4.   

    额,你的代码我有几处不明白,想请教下,望能指教,QQ3425335211、private object sendCount;//这个变量是做什么的?
        out (object)sendCount是什么意思?2、 构造函数gpublic MsgSender(){},实现了什么功能?