/// <summary>
/// 文件名唯一(A.txt => An.txt)
/// </summary>
/// <param name="fullName">文件名</param>
/// <returns></returns>
private string SingleFullName(string fullName)
{
string newfullName = fullName;
FileInfo fileInfo = new FileInfo(newfullName);
if (fileInfo.Exists)
{
int i = 1;
string fileName = fileInfo.Name;
string fileExt = fileInfo.Extension;
int extIndex = fileName.LastIndexOf(fileExt);
string name = fileName.Substring(0,extIndex);
newfullName = name + i + fileExt;
while (true)
{
fileInfo = new FileInfo(newfullName);
if (fileInfo.Exists)
{
i++;
newfullName = name + i + fileExt;
}
else
{
break;
}
}
} return newfullName;
}