string[] folderNames = new[] { "anim“、”音频“、"cleo”、"custom_models“、”数据“、”库“、”模型“、”模型加载器“、”电影“、"SAMP”、“文本”};
字符串gameFolder = oyunDizin;
foreach (var folderName in folderNames)
{
if (Directory.Exists(gameFolder + folderName))
{
MessageBox.Show(folderName + " İzinli");
}
else
{
MessageBox.Show(folderName + " İzinsiz");
}
}我要检测我的gta圣安德烈亚斯文件夹中是否有不同的文件夹?在folderNames中授予文件夹,但如果没有授予文件夹消息框错误,则需要。
发布于 2022-08-11 16:45:27
使用Directory.GetDirectories()扫描根文件夹中的现有文件夹
foreach (string f in Directory.GetDirectories(gameFolder))
{
if(!folderNames.Contains(Path.GetFileName(f)))
{
//show error
}
}https://stackoverflow.com/questions/73324104
复制相似问题