스터디/C#.NET:자료
경로명으로 파일 리스트 가져오기
WhiteAT
2010. 9. 27. 13:32
string 의 경로명으로
해당 경로의 파일을 가져오는 예제입니다.
System.IO.Directory 가 사용됩니다.
전체 소스
소스 일부
private void btnRead_Click(object sender, EventArgs e)
{
if(System.IO.Directory.Exists(txtPath.Text))
{
txtList.Text = "";
foreach (string s in System.IO.Directory.GetFiles(txtPath.Text))
{
txtList.Text +=s+"\r\n" ;
}
}
}