B
Brian Worth
I've just upgraded to VB .NET 2002 Standard. I had an old VB4 program which
consisted of a form containing DriveListBox and a DirListBox and a Go
button.
The program would allow me to select a drive and navigate through to the
lowest level directory of a tree and return the full path down to the lowest
level.
The program would then obtain the list of members using DIR$(fullpathname)
and use FileCopy to copy them to a floppy disk - but storing them on the
floppy with just the lowest level directory name.
As an example, I'd use the DriveListBox to select C: which would cause the
DirListBox to show C:\. Assuming a directory structure of C:\Files\Test\Data
existed, I could navigate down to Data and the string C:\Data\Test\Data
would be returned by the DirListBox. Dir$("C:\Data\Test\Data") would then be
used to return members which would be stored in A:\Data\.
I'm trying to upgrade the program to VB. NET 2002. I see that DriveListBox
and DirListBox aren't supported anymore. I don't have the conversion wizard
as that doesn't come with the Standard version of VB .NET 2002 so I don't
have the compatibility library.
The help indicates that OpenFileDialogBox can replace the two list boxes -
but I can't seem to get this to stop at the lowest level of a directory and
return the full path name down to that inclusive. When I select the lowest
level, it insists on returning the first file name in that lowest level
directory. So in the above example, it will allow me to naviagate down to
C:\Data\Test\Data but if I highlight Data and click Open it then selects the
first file and wants to return that name.
I've tried looking at the help again and notice there is a Directory and a
DirectoryInfo class but examples of how these can be used aren't shown. I'm
very new to VB .NET 2002 and may be missing something obvious so any helpful
hints and tips would be welcome on what the best way to achieve the results
shown in the third paragraph.
Regards,
Brian.
consisted of a form containing DriveListBox and a DirListBox and a Go
button.
The program would allow me to select a drive and navigate through to the
lowest level directory of a tree and return the full path down to the lowest
level.
The program would then obtain the list of members using DIR$(fullpathname)
and use FileCopy to copy them to a floppy disk - but storing them on the
floppy with just the lowest level directory name.
As an example, I'd use the DriveListBox to select C: which would cause the
DirListBox to show C:\. Assuming a directory structure of C:\Files\Test\Data
existed, I could navigate down to Data and the string C:\Data\Test\Data
would be returned by the DirListBox. Dir$("C:\Data\Test\Data") would then be
used to return members which would be stored in A:\Data\.
I'm trying to upgrade the program to VB. NET 2002. I see that DriveListBox
and DirListBox aren't supported anymore. I don't have the conversion wizard
as that doesn't come with the Standard version of VB .NET 2002 so I don't
have the compatibility library.
The help indicates that OpenFileDialogBox can replace the two list boxes -
but I can't seem to get this to stop at the lowest level of a directory and
return the full path name down to that inclusive. When I select the lowest
level, it insists on returning the first file name in that lowest level
directory. So in the above example, it will allow me to naviagate down to
C:\Data\Test\Data but if I highlight Data and click Open it then selects the
first file and wants to return that name.
I've tried looking at the help again and notice there is a Directory and a
DirectoryInfo class but examples of how these can be used aren't shown. I'm
very new to VB .NET 2002 and may be missing something obvious so any helpful
hints and tips would be welcome on what the best way to achieve the results
shown in the third paragraph.
Regards,
Brian.