i want to rename a folder/file on runtime in my window explorer when ever i click on the folder…
i know so far that file.move is used to rename but how to enter file name on runtime?
private void renameToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
string DestinationFolder = ListviewCurrentFolderPath;
string CurrentName = DestinationFolder + "FileName";//in filename i want to edit value on run time
if (Directory.Exists(DestinationFolder))
{
// Directory.Move( Path.Combine(new string[] { DestinationFolder,Path.GetFileName(file) }));
File.Move( Path.Combine(new string[] { DestinationFolder, CurrentName }));
PopulateListView(DestinationFolder);
}
}
catch (IOException ios)
{
MessageBox.Show(ios.ToString());
}
}
I guess you mean with ‘rename at runtime’, to rename the label of the listview item which affects in renaming the folder…
So, first of all you should look at
I hope this little sample helps you to get the right way 🙂