private void Convertclttosevfolder_Click(object sender, EventArgs e) { JMessageBox.Show(this, "Select save path."); using (var savePfb = new FolderBrowserDialog()) { DialogResult resultx = savePfb.ShowDialog(); if (resultx == DialogResult.OK && !string.IsNullOrWhiteSpace(savePfb.SelectedPath)) { string SavePath = savePfb.SelectedPath; JMessageBox.Show(this, "Select perfect world server map path."); using (var fbd = new FolderBrowserDialog()) { DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { var myFiles = Directory.GetFiles(fbd.SelectedPath, "precinct.clt", SearchOption.AllDirectories); foreach (string path in myFiles) { PretinctFile Region = new PretinctFile(); if (Region.ReadFile(path)) { string fileName = Path.GetFileName(path); string dirName = new DirectoryInfo(Path.GetDirectoryName(path)).Name; string savePath = Path.Combine(SavePath, dirName + "\\" + fileName); Region.SaveFile(savePath, false); } } } } } } JMessageBox.Show(this, "All saved."); }
private void jPictureBox2_Click(object sender, EventArgs e) { if (Read != null) { if (Read.SaveFile(autoOpenPath)) { JMessageBox.Show(this, "Precinct file saved."); } } }