Esempio n. 1
0
        static void Rotate(string current)
        {
            {
                string oldlog2 = GeOldLogFilename(GEN_COUNT);
                if (File.Exists(oldlog2))
                {
                    File.Delete(oldlog2);
                }
            }
            for (int i = GEN_COUNT; i > 0; i--)
            {
                string oldlog1 = GeOldLogFilename(i - 1);
                string oldlog2 = GeOldLogFilename(i);

                if (File.Exists(oldlog1))
                {
                    File.Move(oldlog1, oldlog2);
                }
            }
            {
                string oldlog2 = GeOldLogFilename(0);
                ArchSevenZip.Compress(oldlog2, current);
                File.Delete(current);
            }
        }
Esempio n. 2
0
        string MakeReport(string fullfilename)
        {
            //少し時間がかかるので、しばらくお待ちください表示.
            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this))
                //テンポラリディレクトリを利用する
                using (U.MakeTempDirectory tempdir = new U.MakeTempDirectory())
                {
                    string orignalFilename = OrignalFilename.Text;
                    byte[] s = File.ReadAllBytes(orignalFilename);

                    //セーブデータの回収
                    CollectSaveData(tempdir.Dir);

                    //現在のROMのUPSデータの回収
                    CollectUPSsCurrentROM(tempdir.Dir, s);

                    //動作しないUPSと動作するUPSデータの回収
                    CollectOldUPSs(tempdir.Dir, s);

                    //ログとユーザの説明を書き込む
                    string log = Path.Combine(tempdir.Dir, "log.txt");
                    U.WriteAllText(log, MakeReportLog());

                    //etcの内容をコピー
                    //lintやコメントなどの設定がほしい
                    CopyEtcData(tempdir.Dir);

                    //添付データ
                    AttachData(tempdir.Dir);

                    //7z圧縮
                    InputFormRef.DoEvents(this, R._("7z圧縮中"));
                    return(ArchSevenZip.Compress(fullfilename, tempdir.Dir));
                }
        }
        string MakeFeedBack(string fullfilename)
        {
            //テンポラリディレクトリを利用する
            using (U.MakeTempDirectory tempdir = new U.MakeTempDirectory())
            {
                //セーブデータの回収
                ToolProblemReportForm.CollectSaveData(tempdir.Dir);

                //フィードバックコメント
                File.WriteAllText(Path.Combine(tempdir.Dir, "log.txt"), MakeFeedBackInfo());

                //7z圧縮
                InputFormRef.DoEvents(this, R._("7z圧縮中"));
                return(ArchSevenZip.Compress(fullfilename, tempdir.Dir));
            }
        }