Q&A

  • Listview에 폴더 목록을 공백없이 출력
디렉토리 이름을 날짜로 만들었습니다.



NA - 2001 - 10 - 18

| 19

| 20

| 9 _ 1

| 2

|_ 2002 - 1 - 1

| 2

| 3

| 2 _ 1

| 2



이런식으로 되어있는 폴더이름을 가져와서 리스트 뷰에



2001/10 /18

2001/10 /19

2001/10 /20

2001/9 /1

2001/9 /2

2002/1 /1

2002/1 /2

.....



이렇게 보여주고 싶습니다. 아래의 코드를 실행해보면

결과가



2001/10/18

/19

<<-----------------공백 1줄

9/ 1

2/

<<-----------------공백 2줄

2002/1 /1

2/

.....



이렇게 나옵니다.

제가 바라는 형태로 예쁘게 나오게 할 수 있도록 도와주세요.. 부탁드립니당.. ^ ^*





var

DateList : String;

procedure TForm2.DirSearch(Directory, SearchName: String);

var

SR : TSearchRec;



begin



if Directory[Length(Directory)] <> '' then

Directory := Directory + '';

if FindFirst(Directory + SearchName, faDirectory, SR) = 0 then

begin



repeat

if ((Sr.Attr and faDirectory) = faDirectory) and (SR.Name[1]<>'.') then

begin

DateList := DateList + sr.Name;

DateList := DateList + '/ ';



dirSearch(Directory+SR.Name+'', SearchName); // 재귀호출

ShowDirList(DateList);

DateList := '';

end;

until (FindNext(SR) <> 0);

end;



FindClose(Sr);

end;

0  COMMENTS