示例#1
0
        public static string MainProgram(string[] args)
        {
            if (args.Length == 0)
            {
                return(GetHelpInfo());
            }

            switch (args[0])
            {
            case "/h":
                return(GetHelpInfo());

            case "/v":
                return(GetVersionInfo());

            default:
                using (var enumerator = GetEnumrator(args))
                {
                    haveCurrentValue = enumerator.MoveNext();

                    var target   = GetTargetPath(enumerator);
                    var packName = GetPackFileName(enumerator);
                    var setting  = GetPackagingSetting(enumerator);
                    var key      = GetEncryptKey(enumerator);
                    var ignore   = GetIgnoreFilePath(enumerator).ToList();

                    Packing.Run(target, packName, setting, ignore, key);
                }
                break;
            }

            return("パッキング終了");
        }
示例#2
0
        private void Package()
        {
            var bPass = Password.TakeWhile(c => c != 0x00).Select(sb => (byte)sb).ToArray();
            var pass  = Encoding.UTF8.GetString(bPass, 0, bPass.Length);

            Packing.Run(SrcPath, DstPath, Setting, new string[] { }, pass);
        }
示例#3
0
        private void btn_export_Click(object sender, EventArgs e)
        {
            if (!System.IO.Directory.Exists(targetPath))
            {
                System.Windows.Forms.MessageBox.Show("ディレクトリが設定されていません。");
                return;
            }

            var dialog = new SaveFileDialog();

            dialog.Filter = "パックファイル(*.pack)|*.pack";

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Packing.Run(targetPath, dialog.FileName, PackagingSetting.IgnoreHiddenAttribute, new string[] { }, txt_password.Text);
                System.Windows.Forms.MessageBox.Show("パッケージを出力しました。");
            }
        }