怎么得到history和temp目录并清空它们??

解决方案 »

  1.   

    TEMP与history目录写在注册表HKEY_CURRENT_USER\Environment的TEMP中HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders的history中,用TRegistry类读出注册表再删除文件就可以了
      

  2.   

    这里涉及到一个非常麻烦的问题,就是每一个用户对应的目录都是不同的读取注册表应该是一种方法。给你一些常用的API。你看下
    ExpandEnvironmentStrings
    GetComputerName
    GetCurrentHwProfile
    GetKeyboardType
    GetSysColor
    GetSystemDirectory
    GetSystemInfo
    GetSystemMetrics
    GetThreadDesktop
    GetUserName
    GetVersionEx
    GetWindowsDirectory
    IsProcessorFeaturePresent
    SetComputerName
    SetSysColors
    SystemParametersInfo