我想创建一个临时的文件存放文本,可不可以不自定义临时文件的路径直接由系统来分配路径,使用后再删除啊?
如果可以我又如何去获取系统分配的临时文件的路径和调用那个函数去删除该路径下的文本呢?

解决方案 »

  1.   

    GetTempPathThe GetTempPath function retrieves the path of the directory designated for temporary files.
    DWORD GetTempPath(
      DWORD nBufferLength,
      LPTSTR lpBuffer
    );Parameters
    nBufferLength 
    [in] Size of the string buffer identified by lpBuffer, in TCHARs. 
    lpBuffer 
    [out] Pointer to a string buffer that receives the null-terminated string specifying the temporary file path. The returned string ends with a backslash, for example, C:\TEMP\. 
      

  2.   

    GetTempPath
    GetTempFileName