共用方式為


CFileDialog::GetFileExt

Call this function to retrieve the extension of the filename entered into the dialog box.

CString GetFileExt( ) const;

Return Value

The extension of the filename.

Remarks

For example, if the name of the file entered is DATA.TXT, GetFileExt returns "TXT".

If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, this string contains a sequence of null-terminated strings, with the first string being the directory path of the file group selected, followed by the names of all files selected by the user. To retrieve file pathnames, use the GetStartPosition and GetNextPathName member functions.

Requirements

Header: afxdlgs.h

See Also

Concepts

CFileDialog Class

CFileDialog Members

Hierarchy Chart

CFileDialog::GetPathName

CFileDialog::GetFileName

CFileDialog::GetFileTitle