private void Test_Click(object sender, RoutedEventArgs e) { if (IniExist(folderPath) == true) { Result.AppendText(folderPath + " desktop.ini found\n"); if (folderPath[folderPath.Count() - 1] != '\\') { File.Delete(folderPath + "\\desktop.ini"); } else { File.Delete(folderPath + "desktop.ini"); } if (IniExist(folderPath) == true) { Result.AppendText(folderPath + " desktop.ini failed deleting\n"); } else { Result.AppendText(folderPath + " desktop.ini deleted\n"); FolderIconChanging.ChangeIcon(folderPath, icons[1]); } } else { Result.AppendText(folderPath + " desktop.ini not found\n"); FolderIconChanging.ChangeIcon(folderPath, icons[1]); } }
private string ChangeFolderIcon(string folderPath, string iconPath) { string result = ""; if (IniExist(folderPath) == true) { if (folderPath[folderPath.Count() - 1] != '\\') { File.Delete(folderPath + "\\desktop.ini"); } else { File.Delete(folderPath + "desktop.ini"); } } if (IniExist(folderPath) == false) { FolderIconChanging.ChangeIcon(folderPath, iconPath); result += "Chaging icon\n"; } return(result); }