Beispiel #1
0
        /// <summary>
        /// 预下单,获取订单号
        /// </summary>
        public static string PreOrder(PayParam param)
        {
            string orderUrl = param.SeverUrl + "?" + "TYPE=PreOrder" + "&" + param.ToString();

            string data    = WebTool.getWebData(orderUrl);
            string orderId = WebTool.getNodeData(data, "Result", false).Trim();

            return(orderId);
        }
Beispiel #2
0
        /// <summary>
        /// 查询KEY列对应的数据信息
        /// </summary>
        /// <param name="KEY">列名称</param>
        /// <param name="machinCode">机器码</param>
        /// <param name="soft">软件名称</param>
        /// <returns></returns>
        public string GetValue(string KEY, string machinCode, string soft)
        {
            string Url  = "http://" + QrPayServerAddress + "/pages/onlineserial.aspx?TYPE=GetValue&KEY=" + KEY + "&machinCode=" + machinCode + "&soft=" + soft;
            string data = WebTool.getWebData(Url).Trim();

            if (!data.Equals(""))
            {
                data = Locker.Decrypt(data, machinCode + soft);
                data = WebTool.getNodeData(data, KEY, false);
            }

            return(data);
        }
Beispiel #3
0
        /// <summary>
        /// 获取指定网址中的配置信息
        /// </summary>
        /// <param name="configUrl">配置信息对应网址</param>
        /// <param name="key">配置节点名</param>
        public static String GetWebConfig(string key = "", string configUrl = "")
        {
            //if (configUrl.Equals("")) configUrl = "https://git.oschina.net/joymeng/" + NAMESPACE + "/raw/master/config.txt";
            if (configUrl.Equals(""))
            {
                configUrl = "https://raw.githubusercontent.com/joymeng/" + NAMESPACE + "/master/config.txt";
            }
            if (key.Equals(""))
            {
                return("");
            }

            return(WebTool.getWebData(configUrl, key));
        }
Beispiel #4
0
        /// <summary>
        /// 获取获取ext附加参数中的信息
        /// </summary>
        /// <returns></returns>
        public string ExtInfo(string extKey)
        {
            string Url  = "http://" + QrPayServerAddress + "/pages/softinfo.aspx?TYPE=Select&softName=" + SoftName + "&key=ext";
            string data = WebTool.getWebData(Url).Trim();

            if (!data.Equals(""))
            {
                data  = Locker.Decrypt(data, SoftName); // 使用软件名称解密,加密的金额信息
                price = WebTool.getNodeData(data, "ext", false);
            }
            string extValue = WebTool.getNodeData(data, extKey, false);

            return(extValue);
        }
Beispiel #5
0
        /// <summary>
        /// 获取软件的支付金额信息
        /// </summary>
        /// <returns></returns>
        public string LinkUrl()
        {
            if (!linkUrl.Equals(""))
            {
                return(linkUrl);
            }

            string Url  = "http://" + QrPayServerAddress + "/pages/softinfo.aspx?TYPE=Select&softName=" + SoftName + "&key=linkUrl";
            string data = WebTool.getWebData(Url).Trim();

            linkUrl = data;

            return(data);
        }
Beispiel #6
0
        /// <summary>
        /// 根据机器信息, 在线查询是否已注册码;
        /// TYPE=GetRegSerial&machinCode=XRUM-LYKS-4R2P-QP6H&soft=easyIcon&computerName=计算机名称&userName=用户名称&ext=拓展参数&counter=true
        /// </summary>
        /// <param name="machinCode"></param>
        /// <param name="soft"></param>
        /// <param name="computerName"></param>
        /// <param name="userName"></param>
        /// <param name="ext"></param>
        /// <returns></returns>
        public string GetOnlineSerial(string machinCode, string soft, string computerName = "", string userName = "", string ext = "")
        {
            string counter = "false";

            if (isFirstGetOnlineSerial)
            {
                counter = "true";
                isFirstGetOnlineSerial = false;
            }

            string Url  = "http://" + QrPayServerAddress + "/pages/onlineserial.aspx?TYPE=GetRegSerial&machinCode=" + machinCode + "&soft=" + soft + "&computerName=" + computerName + "&userName="******"&ext=" + ext + "&counter=" + counter;
            string data = WebTool.getWebData(Url).Trim();

            return(data);
        }
Beispiel #7
0
        /// <summary>
        /// 查询订单支付结果
        /// </summary>
        public static string OrderResult(PayParam param, string preOrderId)
        {
            string url      = param.SeverUrl + "?" + "TYPE=OrderResult" + "&" + "preOrderId=" + preOrderId;
            string paramStr = param.ToString();

            string data   = WebTool.getWebData(url);
            string result = WebTool.getNodeData(data, "Result", false).Trim();

            // 使用创建订单时的参数信息,解密查询结果
            if (paramStr != null && !paramStr.Equals(""))
            {
                result = Locker.Decrypt(result, preOrderId + paramStr);
            }

            return(result);
        }
Beispiel #8
0
        /// <summary>
        /// 获取软件的支付金额信息
        /// </summary>
        /// <returns></returns>
        public string getPrice()
        {
            //if (!price.Equals("")) return price;
            string Url  = "http://" + QrPayServerAddress + "/pages/softinfo.aspx?TYPE=Select&softName=" + SoftName + "&key=price";
            string data = WebTool.getWebData(Url).Trim();

            if (!data.Equals(""))
            {
                data  = Locker.Decrypt(data, SoftName); // 使用软件名称解密,加密的金额信息
                price = WebTool.getNodeData(data, "price", false);
            }
            if (price.Equals(""))
            {
                price = "10.00";
            }

            return(price);
        }
Beispiel #9
0
        /// <summary>
        /// 获取key对应的配置信息
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string Get(string key)
        {
            if (url == null || url.Equals(""))
            {
                return("");
            }
            if (key == null || key.Equals(""))
            {
                return("");
            }

            string value = WebTool.getWebData(url, key);

            if (key.Equals("QrPayServerAddress") && value.Equals(""))
            {
                value = "60.205.185.168:8002";
            }

            return(value);
        }