Пример #1
0
        public static string GetToken(string apiKey, string secretKey, string salt)
        {
            string token = ClassMD5.GetMd5Hash(apiKey + salt + secretKey);

            return(System.Web.HttpUtility.UrlEncode(token));
        }
Пример #2
0
        /*public static string GetPublicIP()
         * {
         *      HttpWebRequest request = WebRequest.Create(Properties.Settings.Default.PublicIPWebServicUrl) as HttpWebRequest;
         *
         *      request.Method = "GET";
         *
         *      WebResponse web_response = request.GetResponse();
         *
         *      XmlDocument x_doc = new XmlDocument();
         *      x_doc.Load(web_response.GetResponseStream());
         *
         *      XmlNodeList elemList = x_doc.GetElementsByTagName("body");
         *
         *      string body = (elemList.Count > 0) ? elemList[0].InnerText : "Address:";
         *      string ip = body.Substring(body.IndexOf("Address:") + ("Address:").Length).Trim();
         *
         *      return ip;
         * }*/

        public string GetResultKey(string url)
        {
            return(ClassMD5.GetMd5Hash(String.Format(url, string.Empty)));
        }