私はこのコードをtrue/falseに戻します。与えられたディレクトリに ".exe"が含まれている場合、TrueまたはFalseを返そうとしています
public static bool HasExecutable(string path)
{
var exts = "*.exe";
if (path.AsDirectory().Exists) return true;
if(path.AsDirectory().GetFiles(exts).Any(i => path.Contains(exts))) return true;
return false;
}
}
}
私のアウトプットは、私のプログラムを停止し、エラーである私はここにいくつかのロジック足りませんか?
エラーメッセージは何ですか? –
未処理の例外:System.IO.DirectoryNotFoundException: 'c:\ program files(x86)\ notepad ++'のパスの一部を見つけることができませんでした。 。 –
@Aominèi要素を使用するとエラーが発生します.fileInfoから変換できません。文字列 –