private
void
GhangeNames(
string
filepath,
string
sfm,
int
k)
{
DirectoryInfo inf = new DirectoryInfo(filepath);
FileInfo[] files = inf.GetFiles();
try
{
for ( int i = 0 ; i < files.Length; i ++ )
{
listBox1.Items.Add(files[i].Name);
listBox2.Items.Add(textBox2.Text + (k + i).ToString(sfm) + files[i].Name.Substring(files[i].Name.LastIndexOf( ' . ' )));
files[i].MoveTo(files[i].DirectoryName + @" " + textBox2.Text + (k + i).ToString(sfm) + files[i].Name.Substring(files[i].Name.LastIndexOf( ' . ' )));
}
MessageBox.Show( " 文件名修改结束 " , " 友情提醒 " , MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
}
}
{
DirectoryInfo inf = new DirectoryInfo(filepath);
FileInfo[] files = inf.GetFiles();
try
{
for ( int i = 0 ; i < files.Length; i ++ )
{
listBox1.Items.Add(files[i].Name);
listBox2.Items.Add(textBox2.Text + (k + i).ToString(sfm) + files[i].Name.Substring(files[i].Name.LastIndexOf( ' . ' )));
files[i].MoveTo(files[i].DirectoryName + @" " + textBox2.Text + (k + i).ToString(sfm) + files[i].Name.Substring(files[i].Name.LastIndexOf( ' . ' )));
}
MessageBox.Show( " 文件名修改结束 " , " 友情提醒 " , MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
}
}