コード例 #1
0
 private bool CompleteLoading()
 {
     try
     {
         this.targetFile = this.destFolder.searchForFile(this.targetFilename);
         if (this.targetFile == null)
         {
             this.status       = DecypherTrackExe.DecHeadStatus.Error;
             this.errorMessage = "File not found";
             return(false);
         }
         if (FileEncrypter.FileIsEncrypted(this.targetFile.data, "") != 0)
         {
             return(true);
         }
         this.status       = DecypherTrackExe.DecHeadStatus.Error;
         this.errorMessage = "File is not\nDEC encrypted";
         return(false);
     }
     catch (Exception ex)
     {
         this.status       = DecypherTrackExe.DecHeadStatus.Error;
         this.errorMessage = "Fatal error in loading";
         return(false);
     }
 }
コード例 #2
0
ファイル: DecypherExe.cs プロジェクト: hochladen/Hacknet
        private bool CompleteLoading()
        {
            try
            {
                this.targetFile = this.destFolder.searchForFile(this.targetFilename);
                if (this.targetFile == null)
                {
                    this.status       = DecypherExe.DecypherStatus.Error;
                    this.errorMessage = LocaleTerms.Loc("File not found");
                    return(false);
                }
                switch (FileEncrypter.FileIsEncrypted(this.targetFile.data, this.password))
                {
                case 0:
                    this.status       = DecypherExe.DecypherStatus.Error;
                    this.errorMessage = LocaleTerms.Loc("File is not\nDEC encrypted");
                    return(false);

                case 2:
                    this.status       = DecypherExe.DecypherStatus.Error;
                    this.errorMessage = !(this.password == "") ? LocaleTerms.Loc("Provided Password\nIs Incorrect") : LocaleTerms.Loc("This File Requires\n a Password");
                    return(false);

                default:
                    return(true);
                }
            }
            catch (Exception ex)
            {
                this.status       = DecypherExe.DecypherStatus.Error;
                this.errorMessage = LocaleTerms.Loc("Fatal error in loading");
                return(false);
            }
        }
コード例 #3
0
        private bool CompleteLoading()
        {
            try
            {
                targetFile = destFolder.searchForFile(targetFilename);
                if (targetFile == null)
                {
                    status       = DecypherStatus.Error;
                    errorMessage = "File not found";
                    return(false);
                }
                switch (FileEncrypter.FileIsEncrypted(targetFile.data, password))
                {
                case 0:
                    status       = DecypherStatus.Error;
                    errorMessage = "File is not\nDEC encrypted";
                    return(false);

                case 2:
                    status       = DecypherStatus.Error;
                    errorMessage = !(password == "")
                            ? "Provided Password\nIs Incorrect"
                            : "This File Requires\n a Password ";
                    return(false);

                default:
                    return(true);
                }
            }
            catch (Exception ex)
            {
                status       = DecypherStatus.Error;
                errorMessage = "Fatal error in loading";
                return(false);
            }
        }