Example #1
0
        public Form1()
        {
            InitializeComponent();

            // 从config中取出url,weixin代理账号
            string strDp2Url = "http://dp2003.com/dp2library/rest/";//http://localhost/dp2library/xe/rest";//"
            string strDp2UserName = "******";// "supervisor";//
            // todo 密码改为加密格式
            string strDp2Password = "******";// "";//

            // 错误日志目录
            string strLogDir = "C:\\dp2BatchForWeiXin_log";
            PathUtil.CreateDirIfNeed(strLogDir);	// 确保目录创建

            string strDp2WeiXinUrl = "http://dp2003.com/dp2weixin";

            // 将命令服务类改为单一实例方式 20151215
            dp2CommandServer.Instance.Init(strDp2Url,
                strDp2UserName,
                strDp2Password,
                strDp2WeiXinUrl,
                strLogDir);

            //命令集合
            this.CmdContiner = new CommandContainer();
        }
Example #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public Instance()
        {
            // 从config中取出url,weixin代理账号
            string strDp2Url = "http://dp2003.com/dp2library/rest/";
            string strDp2UserName = "******";
            // todo 密码改为加密格式
            string strDp2Password = "******";

            // 错误日志目录
            string strDp2WeiXinLogDir = "C:\\dp2weixin_log";
            PathUtil.CreateDirIfNeed(strDp2WeiXinLogDir);	// 确保目录创建

            string strDp2WeiXinUrl = "http://dp2003.com/dp2weixin";

            // 将命令服务类改为单一实例方式 2015-12-15
            dp2CommandServer.Instance.Init(strDp2Url,
                strDp2UserName,
                strDp2Password,
                strDp2WeiXinUrl,
                strDp2WeiXinLogDir);

            //命令集合
            this.CmdContiner = new CommandContainer();
        }