public static GetNewFileName ( string directory, string baseFileName, string extension ) : string | ||
directory | string | Directory that the file should live in. |
baseFileName | string | |
extension | string | may be null, in which case the .[extension] part /// is not added. |
return | string |
public static string GetNewFileName(string directory, string baseFileName, string extension)
{
// Get the new file name
string fileName = GetNewFileOrDirectoryNameWithoutCreatingAnything(directory, baseFileName, extension);
// Create an empty file to mark it as taken
StreamWriter sw = new StreamWriter(fileName);
sw.Write("");
sw.Close();
return fileName;
}