大量のリネームがあったのでamazon等からテキストデータを持ってきて利用した。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
using System; using System.Windows.Forms; namespace cd_ren { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void listBox1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Copy; } else { e.Effect = DragDropEffects.None; } } private void button3_Click(object sender, EventArgs e) { int i = listBox1.SelectedIndex; if (i <= 0) return; var o = listBox1.SelectedItem; listBox1.Items.RemoveAt(i); listBox1.Items.Insert(i - 1, o); listBox1.SelectedIndex = i - 1; } private void button1_Click(object sender, EventArgs e) { int i = listBox1.SelectedIndex; if (listBox1.Items.Count - 1 == i) return; var o = listBox1.SelectedItem; listBox1.Items.RemoveAt(i); listBox1.Items.Insert(i + 1, o); listBox1.SelectedIndex = i + 1; } private void listBox1_DragDrop(object sender, DragEventArgs e) { string[] file_names = (string[])e.Data.GetData(DataFormats.FileDrop, false); listBox1.Items.AddRange(file_names); } private void button2_Click(object sender, EventArgs e) { for(int r = 0; r < listBox1.Items.Count; r++ ) { if (textBox1.Lines.Length - 1 < r || textBox1.Lines[r] == "") return; var original_full_path = listBox1.Items[r].ToString(); var new_full_path = System.IO.Path.GetDirectoryName(listBox1.Items[r].ToString()) + @"\" + textBox1.Lines[r].ToString() + ".mp3"; System.IO.File.Copy(original_full_path, new_full_path); } } } } |