Unten finden
Code: Select all
The Animals - House of the Rising Sun (1964) + clip compilation ♫♥ 50 YEARS - counting.mp3
Der Code, den ich derzeit verwende
Code: Select all
public static string RemoveIllegalFileNameChars(string input, string replacement = "")
{
if (input.Contains("?"))
{
input = input.Replace('?', char.Parse(" "));
}
if (input.Contains("&"))
{
input = input.Replace('&', char.Parse("-"));
}
var regexSearch = new string(Path.GetInvalidFileNameChars()) +
new string(Path.GetInvalidPathChars());
var r = new Regex(string.Format("[{0}]", Regex.Escape(regexSearch)));
return r.Replace(input, replacement);
}