zoukankan      html  css  js  c++  java
  • CFileFind::GetFileName

    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:

    Root of C:\WINDOWS\SYSTEM.INI is C:\WINDOWS
    Title of C:\WINDOWS\SYSTEM.INI is SYSTEM
    Path of C:\WINDOWS\SYSTEM.INI is C:\WINDOWS\SYSTEM.INI
    URL of C:\WINDOWS\SYSTEM.INI is file://C:\WINDOWS\SYSTEM.INI
    Name of C:\WINDOWS\SYSTEM.INI is SYSTEM.INI
    
  • 相关阅读:
    第 9 章 类
    导入模块
    第 8 章 函数
    第七章 用户输入和while语句
    第六章 字典
    测试经理/组长职责
    测试的发展之路
    【转】测试流程
    一个网页通用的测试用例(借鉴他人的保存,加注释)
    QTP自动化测试框架简述
  • 原文地址:https://www.cnblogs.com/joeblackzqq/p/1947453.html
Copyright © 2011-2022 走看看