コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            //RarFile test =new RarFile(@"E:\", "bbb.rar",true, 8, "123456789zxcvbnmasdfghjklqwertyuiop");
            //test.MulithreadExtract(1);
            RarFile test = new RarFile(@"E:\", "bbb.rar", "321654987");

            test.DoExtract();
        }
コード例 #2
0
ファイル: StartOne.xaml.cs プロジェクト: boby16/MyCustProject
        private void method_9()
        {
            string arg    = "000";
            bool   bool_  = SurveyMsg.VersionID.IndexOf("正式版") <= -1;
            alioss alioss = new alioss(SurveyMsg.OSSRegion, bool_, SurveyMsg.ProjectId);

            if (!alioss.CreateOss())
            {
                this.txtMsg.Text = alioss.OutMessage;
                return;
            }
            SurveyConfigBiz surveyConfigBiz   = new SurveyConfigBiz();
            string          byCodeText        = surveyConfigBiz.GetByCodeText("UploadSequence");
            string          newUploadSequence = alioss.GetNewUploadSequence(byCodeText);

            if (byCodeText != newUploadSequence)
            {
                surveyConfigBiz.Save("UploadSequence", newUploadSequence);
            }
            this.strRarFileName = string.Format("{0}_{1}_{2:MMdd_HHmmss}.rar", byCodeText, arg, DateTime.Now);
            RarFile rarFile = new RarFile();

            if (!rarFile.Compress(this.strRarSource + "*.dat", this.strRarOutputFolder, this.strRarFileName, this.strRarPassword, true, true))
            {
                this.txtMsg.Text       = SurveyMsg.MsgNoDataFile;
                this.btnExit.IsEnabled = true;
                return;
            }
            Thread.Sleep(1000);
            if (alioss.UploadToOss(this.strRarOutputFolder, this.strRarFileName))
            {
                surveyConfigBiz.Save("LastUploadFile", this.strRarFileName);
                this.oSurvey.AddSurvyeSync(this.MySurveyId, SurveyMsg.MsgUploadSingleVersion, 1);
                string string_  = this.strRarOutputFolder + this.strRarFileName;
                string string_2 = this.strRarOutputFolder + this.strRarFileName.Replace(".rar", "\\").Substring(byCodeText.Length + 1);
                bool   flag     = rarFile.Extract(string_, this.strRarOutputFolder, string_2, this.strRarPassword);
                Thread.Sleep(1000);
                if (flag)
                {
                    string searchPattern = "S*.dat";
                    foreach (FileInfo fileInfo in new DirectoryInfo(Environment.CurrentDirectory + "\\OutPut").EnumerateFiles(searchPattern, SearchOption.TopDirectoryOnly))
                    {
                        fileInfo.Delete();
                    }
                }
                this.txtMsg.Text = SurveyMsg.MsgEndSurveyInfo;
                return;
            }
            this.txtMsg.Text = alioss.OutMessage;
        }