else if (currentLightningFolderPath != null)
{
int currentLightningEndFrame = processedFrames;
string frameRange = $"[{currentLightningStartFrame:D4}-{currentLightningEndFrame:D4}]";
string lightningFolderName = $"Lightning{"D3"}_{frameRange}";
Directory.Move(currentLightningFolderPath, Path.Combine(selectedFolderPath, lightningFolderName));
currentLightningFolderPath = null;
framesCaptured = 0; // Reset the counter
}
我以为“D3”会这样做,但硬盘上的文件夹名称是:
LightningD3_和下一个也以LightningD3_开头
我希望文件夹以Lightning001_开始,然后以Lightning002_开始,以此类推。
1条答案
按热度按时间41ik7eoe1#
D3
是一个格式说明符,告诉编译器数字应该打印为3位数。你错过了你告诉编译器 * 你想以这种方式打印哪个数字 * 的部分。相反,您添加了引号以使其编译。但这只意味着你得到的是固定的字符串“D3”,而不是你想要的格式化变量。
你的工作是拥有并填充
yourVariable
你想要的值。