Exemplo n.º 1
0
        /// <summary>
        /// 附件加密
        /// </summary>
        /// <param name="inFileName">待加密文件</param>
        /// <param name="outFileName">加密后文件</param>
        /// <param name="type">加密方式:0轻度加密,1深度加密</param>
        /// <returns></returns>
        public static bool AttEncrypt(string inFileName, string outFileName, int t)
        {
            string type = "";

            if (inFileName.Trim().Length == 0 || outFileName.Trim().Length == 0)
            {
                return(false);
            }
            if (t != 0 && t != 1)
            {
                return(false);
            }
            if (t == 0)
            {
                type = "ICoder.VERSON01";
            }
            if (t == 1)
            {
                type = "ICoder.VERSON02";
            }
            try
            {
                AttMainClient attMain = new AttMainClient();
                attMain.encrypt(inFileName, outFileName, type);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 附件解密
 /// </summary>
 /// <param name="inFileName">待解密文件</param>
 /// <param name="outFileName">解密后文件</param>
 /// <returns></returns>
 public static bool AttDecrypt(string inFileName, string outFileName)
 {
     try
     {
         if (inFileName.Trim().Length == 0 || outFileName.Trim().Length == 0)
         {
             return(false);
         }
         AttMainClient attMain = new AttMainClient();
         attMain.decrypt(inFileName, outFileName);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }