示例#1
0
        //创建package签名
        public virtual string createMd5Sign()
        {
            StringBuilder sb    = new StringBuilder();
            ArrayList     akeys = new ArrayList(parameters.Keys);

            akeys.Sort();

            foreach (string k in akeys)
            {
                string v = (string)parameters[k];
                if (null != v && "".CompareTo(v) != 0 &&
                    "sign".CompareTo(k) != 0 && "".CompareTo(v) != 0)
                {
                    sb.Append(k + "=" + v + "&");
                }
            }
            string sign = MD5Util.GetMD5(sb.ToString() + "key=" + this.key, getCharset()).ToUpper();

            this.setParameter("sign", sign);
            return(sign);
        }
示例#2
0
        public static string getNoncestr()
        {
            Random random = new Random();

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