コード例 #1
0
        private bool CreateNotice(string strdownfiles, string strid)
        {
            #region 加载系统通知
            ArrayList alDownNoti = new ArrayList();
            alDownNoti = m1.DownNotice(strid);
            if (alDownNoti == null)
            {
                clog.WriteLine("加载系统通知错误");
                return(false);
            }
            #endregion

            StreamWriter   swFile = new StreamWriter(strdownfiles + ".tmp", true);
            StructToString sts    = new StructToString();

            #region 写系统通知
            CMSMStruct.NoticeStruct notitmp = null;
            swFile.WriteLine("NOTITOL=" + alDownNoti.Count.ToString());
            for (int i = 0; i < alDownNoti.Count; i++)
            {
                notitmp = alDownNoti[i] as CMSMStruct.NoticeStruct;
                swFile.WriteLine(sts.ToNoticeString(notitmp));
            }
            swFile.WriteLine("END");
            #endregion

            swFile.Close();

            #region 加密
            DESEncryptor dese = new DESEncryptor();
            dese.InputFilePath = strdownfiles + ".tmp";
            dese.OutFilePath   = strdownfiles;
            dese.EncryptKey    = "cmsmyykx";
            dese.FileDesEncrypt();
            if (dese.NoteMessage != null)
            {
                clog.WriteLine(dese.NoteMessage);
                return(false);
            }
            dese = null;
            #endregion

            if (System.IO.File.Exists(strdownfiles + ".tmp"))
            {
                System.IO.File.Delete(strdownfiles + ".tmp");
            }

            return(true);
        }
コード例 #2
0
        private bool CreateDataLocal(string strlasttime, string strdownfiles)
        {
            #region 加载会员资料
            ArrayList alDownUser = new ArrayList();
            alDownUser = m1.DownAssData(strlasttime);
            if (alDownUser == null)
            {
                clog.WriteLine("加载会员资料错误");
                return(false);
            }
            #endregion

            StreamWriter swFile = new StreamWriter(strdownfiles + ".tmp", true);

            #region 写会员资料
            CMSMStruct.AssociatorStruct asstmp = null;
            StructToString sts = new StructToString();
            swFile.WriteLine("USERTOL=" + alDownUser.Count.ToString());
            for (int i = 0; i < alDownUser.Count; i++)
            {
                asstmp = alDownUser[i] as CMSMStruct.AssociatorStruct;
                swFile.WriteLine(sts.ToAssString(asstmp));
            }
            swFile.WriteLine("END");
            #endregion

            swFile.Close();

            #region 加密
            DESEncryptor dese = new DESEncryptor();
            dese.InputFilePath = strdownfiles + ".tmp";
            dese.OutFilePath   = strdownfiles;
            dese.EncryptKey    = "cmsmyykx";
            dese.FileDesEncrypt();
            if (dese.NoteMessage != null)
            {
                clog.WriteLine(dese.NoteMessage);
                return(false);
            }
            dese = null;
            #endregion

            if (System.IO.File.Exists(strdownfiles + ".tmp"))
            {
                System.IO.File.Delete(strdownfiles + ".tmp");
            }

            return(true);
        }
コード例 #3
0
        private bool CreateDataLocalPara(string strdownfiles)
        {
//			#region 加载系统参数
//			ArrayList alDownSysPara=new ArrayList();
//			alDownSysPara=m1.DownSysPara();
//			if(alDownSysPara==null)
//			{
//				clog.WriteLine("加载系统参数错误");
//				return false;
//			}
//			#endregion

            #region 加载商品资料
            ArrayList alDownGoods = new ArrayList();
            alDownGoods = m1.DownGoodsData();
            if (alDownGoods == null)
            {
                clog.WriteLine("加载商品资料错误");
                return(false);
            }
            #endregion

            StreamWriter   swFile = new StreamWriter(strdownfiles + ".tmp", true);
            StructToString sts    = new StructToString();

//			#region 写系统参数
//			CMSMStruct.CommStruct Commtmp=null;
//			swFile.WriteLine("COMMTOL=" + alDownSysPara.Count.ToString());
//			for(int i=0;i<alDownSysPara.Count;i++)
//			{
//				Commtmp=alDownSysPara[i] as CMSMStruct.CommStruct;
//				swFile.WriteLine(sts.ToCommCodeString(Commtmp));
//			}
//			swFile.WriteLine("END");
//			#endregion

            #region 写商品资料
            CMSMStruct.GoodsStruct goodstmp = null;
            swFile.WriteLine("GOODTOL=" + alDownGoods.Count.ToString());
            for (int i = 0; i < alDownGoods.Count; i++)
            {
                goodstmp = alDownGoods[i] as CMSMStruct.GoodsStruct;
                swFile.WriteLine(sts.ToGoodsString(goodstmp));
            }
            swFile.WriteLine("END");
            #endregion

            swFile.Close();

            #region 加密
            DESEncryptor dese = new DESEncryptor();
            dese.InputFilePath = strdownfiles + ".tmp";
            dese.OutFilePath   = strdownfiles;
            dese.EncryptKey    = "cmsmyykx";
            dese.FileDesEncrypt();
            if (dese.NoteMessage != null)
            {
                clog.WriteLine(dese.NoteMessage);
                return(false);
            }
            dese = null;
            #endregion

            if (System.IO.File.Exists(strdownfiles + ".tmp"))
            {
                System.IO.File.Delete(strdownfiles + ".tmp");
            }

            return(true);
        }