Exemplo n.º 1
0
        //创建package签名
        public virtual string createMd5Sign(string key, string value)
        {
            var sb = new StringBuilder();

            var akeys = new ArrayList(parameters.Keys);

            akeys.Sort();

            foreach (string k in akeys)
            {
                var v = (string)parameters[k];
                if (null != v && "".CompareTo(v) != 0 && "sign".CompareTo(k) != 0 && "key".CompareTo(k) != 0)
                {
                    sb.Append(k + "=" + v + "&");
                }
            }

            sb.Append(key + "=" + value);
            //return sb.ToString();

            string sign = MD5Util.GetMD5(sb.ToString(), getCharset()).ToUpper();

            return(sign);
        }
Exemplo n.º 2
0
        public static string getNoncestr()
        {
            Random random = new Random();

            return(MD5Util.GetMD5(random.Next(1000).ToString(), "utf-8"));
        }