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에서 변환 할 수 없습니다. 문자열을 –