コード例 #1
0
        /// <summary>
        /// 注册P2P应用基本信息(可以选择不立即载入Passport以节省系统启动时间)
        /// </summary>
        /// <param name="appKey">P2P后台申请到微信应用后的AppKey</param>
        /// <param name="secret">AppKey对应的Secret</param>
        /// <param name="url">API地址,建议使用默认值</param>
        /// <param name="getPassportImmediately">是否马上获取Passport,默认为False</param>
        private static void Register(string appKey, string secret, string url = DEFAULT_URL, bool getPassportImmediately = false)
        {
            if (PassportCollection.Url != url)
            {
                PassportCollection.Url = url + ApiPath;
            }

            PassportCollection[appKey] = new PassportBag(appKey, secret, url + ApiPath);
            if (getPassportImmediately)
            {
                ApplyPassport(appKey, secret, url);
            }
        }
コード例 #2
0
        /// <summary>
        /// 注册P2P应用基本信息(可以选择不立即载入Passport以节省系统启动时间)
        /// </summary>
        /// <param name="appKey">P2P后台申请到微信应用后的AppKey</param>
        /// <param name="secret">AppKey对应的Secret</param>
        /// <param name="url">API地址,建议使用默认值</param>
        /// <param name="getPassportImmediately">是否马上获取Passport,默认为False</param>
        private static void Register(string appKey, string secret, string url = DEFAULT_URL, bool getPassportImmediately = false)
        {
            if (PassportCollection.Url != url)
            {
                PassportCollection.Url = url + ApiPath;
            }

            PassportCollection[appKey] = new PassportBag(appKey, secret, url + ApiPath);
            if (getPassportImmediately)
            {
                ApplyPassport(appKey, secret, url);
            }
        }
コード例 #3
0
        /// <summary>
        /// 注册P2P应用基本信息(可以选择不立即载入Passport以节省系统启动时间)
        /// </summary>
        /// <param name="appKey">P2P后台申请到微信应用后的AppKey</param>
        /// <param name="secret">AppKey对应的Secret</param>
        /// <param name="url">API地址,建议使用默认值</param>
        /// <param name="getPassportImmediately">是否马上获取Passport,默认为False</param>
        private static void Register(string appKey, string secret, string url = DEFAULT_URL, bool getPassportImmediately = false)
        {
            //if (PassportCollection.BasicUrl != url)
            //{
            ////不使用默认地址
            PassportCollection.BasicUrl = url + BasicApiPath;
            PassportCollection.MarketingToolUrl = url + MarketingToolApiPath;
            //}

            PassportCollection[appKey] = new PassportBag(appKey, secret, url + BasicApiPath);
            if (getPassportImmediately)
            {
                ApplyPassport(appKey, secret, url);
            }
        }
コード例 #4
0
        /// <summary>
        /// 注册P2P应用基本信息(可以选择不立即载入Passport以节省系统启动时间)
        /// </summary>
        /// <param name="appKey">P2P后台申请到微信应用后的AppKey</param>
        /// <param name="secret">AppKey对应的Secret</param>
        /// <param name="url">API地址,建议使用默认值</param>
        /// <param name="getPassportImmediately">是否马上获取Passport,默认为False</param>
        private static void Register(string appKey, string secret, string url = DEFAULT_URL, bool getPassportImmediately = false)
        {
            //if (PassportCollection.BasicUrl != url)
            //{
            ////不使用默认地址
            PassportCollection.BasicUrl         = url + BasicApiPath;
            PassportCollection.MarketingToolUrl = url + MarketingToolApiPath;
            //}

            PassportCollection[appKey] = new PassportBag(appKey, secret, url + BasicApiPath);
            if (getPassportImmediately)
            {
                ApplyPassport(appKey, secret, url);
            }
        }