VB:
Imports System.IO
Namespace Helper
Public Class FileNameHelper
Public Shared Function GetSafeFilename(filename As String) As String
Return String.Join("_", filename.Split(Path.GetInvalidFileNameChars()))
End Function
End Class
End NameSpace
Namespace Helper
Public Class FileNameHelper
Public Shared Function GetSafeFilename(filename As String) As String
Return String.Join("_", filename.Split(Path.GetInvalidFileNameChars()))
End Function
End Class
End NameSpace
c#
public string GetSafeFilename(string filename)
{
return string.Join("_", filename.Split(Path.GetInvalidFileNameChars()));
}
{
return string.Join("_", filename.Split(Path.GetInvalidFileNameChars()));
}
Kopierversionen:
Imports System.IO Namespace Helper Public Class FileNameHelper Public Shared Function GetSafeFilename(filename As String) As String Return String.Join("_", filename.Split(Path.GetInvalidFileNameChars())) End Function End Class End Namespacepublic string GetSafeFilename(string filename) { return string.Join("_", filename.Split(Path.GetInvalidFileNameChars())); }