ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
06-20-2011 09:27 AM
Hello, is there a way to load files (which are in a given folder) in a listbox automatically at startup of my program?
And perhaps can also delete automatically the contents of that folder when you exit the program?
Thanks
Solved! Go to Solution.
06-20-2011 09:54 AM
You can use the functions GetFirstFile and GetNextFile to obtain all files with a given search path. The file names can then be inserted into a listbox using InsertListItem.
06-20-2011 10:00 AM
I'll try and let you know.
thank you very much
regards
06-20-2011 10:41 AM
Wolfgang Sorry, but I can not make it work. The files that are in the folder C: \ TEST all have the same extension (*. dxf), but I don't know their full name ... the program should recognize their name and add them in the listbox (using their own name).
06-20-2011 10:58 AM
Hello ViperNaples,
this example should be what you are looking for; it is more complete than what you have described, as it scans also for subdirectories and lists their content also.
06-20-2011 11:04 AM
How did you use the functions?
For example, GetFirstFile ( "*.dxf", 1, 1, 1, 1, 1, 1, fileName ); returns the first file name matching your search critereon in fileName.
06-20-2011 11:10 AM
Grazie Roberto, darò un'occhiata all'esempio. I tuoi consigli sono sempre utilissimi
06-20-2011 11:11 AM
Wolfgang, i use the function in this way:
GetFirstFile ("c:\\TEST", 1, 0, 0, 0, 0, 0, nameFile);