首页 > 代码库 > AX中API的简单调用

AX中API的简单调用

FilePath    folder = "E:\\NewFolder1";
    FilePath    filePath;
    container   fileInfo;
    int         fileHandle;
    FileName    _FileName;
    ;

    _FileName = folder;
    filePath = _FileName;

    if (substr(_FileName,strlen(_FileName)-1,1) == ‘\\‘)
    {
        _FileName = _FileName + ‘*.*‘;
    }
    else
    {
        _FileName = _FileName + ‘\\*.*‘;
        filePath = filePath + ‘\\‘;
    }

    fileInfo = winAPI::findFirstFile(_FileName);
    fileHandle = conpeek(fileInfo,1);

    _FileName = winapi::findNextFile(fileHandle);
   
    while (_FileName)
    {
        _FileName = winapi::findNextFile(fileHandle);

        if (_FileName != "")
             winAPI::deleteFile(filePath + _FileName);

    }