From dff3f7d053c021f21da03f65299dfe970ac4d68b Mon Sep 17 00:00:00 2001 From: kinchanramen Date: Mon, 18 Mar 2024 12:06:58 +0900 Subject: [PATCH] =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FolderCopy/Form1.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/FolderCopy/Form1.cs b/FolderCopy/Form1.cs index 56b4c01..d858574 100644 --- a/FolderCopy/Form1.cs +++ b/FolderCopy/Form1.cs @@ -28,11 +28,20 @@ private void button1_Click(object sender, EventArgs e) string sourceDirName = textBox1.Text; // コピー後のディレクトリパス string destDirName = textBox2.Text; + string pathnamesource=Path.GetFileName(sourceDirName); + string pathnamedest=Path.GetFileName(destDirName); + /*if (pathnamesource!=".minecraft"||pathnamedest!=".minecraft") { + MessageBox.Show("パスは[.minecraft]まで必要です"); + }*/ // ディレクトリをコピーする CopyDirectory(sourceDirName, destDirName); - if (!options.Checked && !config.Checked && !resourcepacks.Checked && !schematics.Checked && !saves.Checked && !screenshots.Checked && !XaeroWaypoints.Checked && !XaeroWorldMap.Checked && !String.IsNullOrEmpty(textBox1.Text) && !String.IsNullOrEmpty(textBox2.Text)) + if (pathnamesource != ".minecraft" || pathnamedest != ".minecraft") + { + MessageBox.Show("パスは[.minecraft]まで必要です"); + } + else if (!options.Checked && !config.Checked && !resourcepacks.Checked && !schematics.Checked && !saves.Checked && !screenshots.Checked && !XaeroWaypoints.Checked && !XaeroWorldMap.Checked && !String.IsNullOrEmpty(textBox1.Text) && !String.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("何も選択されていません"); } @@ -144,7 +153,7 @@ public void CopyDirectory2(string sourceDirName, string destDirName) string[] files = Directory.GetFiles(sourceDirName); foreach (string file in files) { - if (Path.GetFileName(file) == "hanemod-client.toml") + if (Path.GetFileName(file) == "hanemod-client.json") { Console.WriteLine("hanemodのconfigは移行できません"); }