1
0
mirror of https://github.com/chylex/Backup-Essentials.git synced 2025-08-25 23:35:11 +02:00
Files
BackupEssentials
Backup
Controls
Data
Pages
Properties
Resources
Sys
Utils
FileUtils.cs
KeyEqualityComparer.cs
NativeMethods.cs
NumberSerialization.cs
ObservableDictionary.cs
ProgramArgsParser.cs
SafeDictionary.cs
ScheduledUpdate.cs
StringDictionarySerializer.cs
WindowsFileUtils.cs
WindowsVersion.cs
WpfExtensions.cs
App.xaml
App.xaml.cs
AppPageManager.cs
BackupEssentials.csproj
BackupReportWindow.xaml
BackupReportWindow.xaml.cs
BackupWindow.xaml
BackupWindow.xaml.cs
MainWindow.xaml
MainWindow.xaml.cs
TestingWindow.xaml
TestingWindow.xaml.cs
.gitignore
BackupEssentials.sln
LICENSE
README.md
Backup-Essentials/BackupEssentials/Utils/WindowsFileUtils.cs
2015-05-04 19:02:00 +02:00

18 lines
541 B
C#

using System.Text;
namespace BackupEssentials.Utils{
static class WindowsFileUtils{
private static readonly string InvalidChars = @"<>:/\|?*"+'"';
public static string ReplaceInvalidFileCharacters(string filename, char replacement){
StringBuilder build = new StringBuilder(filename);
for(int a = 0; a < build.Length; a++){
if (build[a] < 32 || InvalidChars.IndexOf(build[a]) != -1)build[a] = replacement;
}
return build.ToString();
}
}
}