Example #1
0
        //加密
        public bool SetEncryptionContent(string sRespData, ref string sEncryptMsg)
        {
            //如果为公众平台且未使用加密
            if (this._wxPlatType == WxPlatFormTypeEnum.GZ)
            {
                WXGZConfigEntity gzConfig = XmlToEntity.GetGZConfig();
                if (string.IsNullOrEmpty(gzConfig.EncodingAESKey))
                {
                    sEncryptMsg = sRespData;
                    return(true);
                }
            }
            int ret = this._wxcpt.EncryptMsg(sRespData, ConvertDateTime.GetTimeStamp(), new Random().Next(100000000, 999999999).ToString(), ref sEncryptMsg);

            if (ret != 0)
            {
                //System.Console.WriteLine( "ERR: EncryptMsg Fail, ret: " + ret );
                return(false);
            }
            return(true);
        }
Example #2
0
 /// <summary>
 /// 获取TimesTamp
 /// </summary>
 /// <returns></returns>
 public static string GetTimesTamp()
 {
     return(ConvertDateTime.GetTimeStamp());
 }