string path = AppDomain.CurrentDomain.BaseDirectory;
string[] filePaths = Directory.GetFiles(path, "*.txt");
foreach (string file in filePaths)
{
cboLanden.Items.Add(file);
}
이것은 내 코드이며 전체 경로를 반환하며 내 콤보 상자의 경로가없는 이름 만 갖고 싶습니다.어떻게 콤보 상자를 .txt로 채우지 만 이름없이 경로 만 채울 수 있습니까?
감사합니다.
오류 '경로' 'System.IO.Path'와 'System.Windows.Shapes.Path'Path.GetFileName에 오류 사이의 모호한 기준은? 나는 using.windows.shape을 추가했다. – Maxim
@ user3173605'System.IO.Path.GetFileName()'과 같은 정규화 된 이름을 사용하십시오 –
답장을 보내 주셔서 감사합니다! – Ahmad