Esempio n. 1
0
        /// <summary>
        /// 压缩DataTable
        /// </summary>
        /// <param name="mydt">DataTable</param>
        /// <returns></returns>
        public static byte[] DataTableToZip(DataTable mydt)
        {
            DataSet myds = new DataSet();

            myds.Tables.Add(mydt.Copy());
            byte[] mybt = YezhanbafangCore.GetBinaryFormatDataSet(myds);
            return(YezhanbafangCore.CompressData(mybt));
        }
Esempio n. 2
0
 /// <summary>
 /// 压缩DataSet
 /// </summary>
 /// <param name="myds">DateSet</param>
 /// <returns></returns>
 public static byte[] DataSetToZip(DataSet myds)
 {
     byte[] mybys = YezhanbafangCore.GetBinaryFormatDataSet(myds);
     return(YezhanbafangCore.CompressData(mybys));
 }
Esempio n. 3
0
 /// <summary>
 /// 压缩字符串
 /// </summary>
 /// <param name="str">输入</param>
 /// <returns>压缩后的byte[]</returns>
 public static byte[] StringToZip(string str)
 {
     byte[] myby = YezhanbafangCore.StringToBytes(str);
     return(YezhanbafangCore.CompressData(myby));
 }