Example
Cfilefind Finder; static const tchar szfiletofind [] = _ T ("C: \ Windows \ System. ini "); bool bresult = finder. findfile (szfiletofind); If (bresult) {finder. findnextfile (); cout <"root of" <szfiletofind; cout <"is" <(lpctstr) finder. getroot (); cout <Endl; cout <"title of" <szfiletofind; cout <"is" <(lpctstr) finder. getfiletitle (); cout <Endl; cout <"path of" <szfiletofind; cout <"is" <(lpctstr) finder. getfilepath (); cout <Endl; cout <"URL of" <szfiletofind; cout <"is" <(lpctstr) finder. getfileurl (); cout <Endl; cout <"name of" <szfiletofind; cout <"is" <(lpctstr) finder. getfilename (); cout <Endl; finder. close ();} else cout <"You have no" <szfiletofind <"file. "<Endl;
Example output
Assumes that the file C: \ WINDOWS \ SYSTEM. ini exists:
RootOf C: \ WINDOWS \ SYSTEM. INI is c: \ WINDOWSTitleOf C: \ WINDOWS \ SYSTEM. INI is SystemPathOf C: \ WINDOWS \ SYSTEM. INI is C: \ WINDOWS \ SYSTEM. iniURLOf C: \ WINDOWS \ SYSTEM. INI is file: // C: \ WINDOWS \ SYSTEM. iniNameOf C: \ WINDOWS \ SYSTEM. INI is system. ini