|
|
简要标题 mountain, 关于取得windows临时文件的目录可以这样做 const MAX_PATH = 260 Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (Byval nBufferLength As Long, Byval lpBuffer As String) As Long Public Function GetTempDirPath( fAddSep As Integer ) As String ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' // Dim sResult As String * MAX_PATH Dim lRet As Long lRet = GetTempPath( MAX_PATH, sResult ) If ( 0 = lRet )Then GetTempDirPath = "" Exit Function End If GetTempDirPath = sResult ' // 返回字符串的最右边字符是分隔符 If ( fAddSep > 0 ) Then Exit Function End If ' // 去掉右边的分隔符 GetTempDirPath = Left( GetTempDirPath, lstrlen( GetTempDirPath ) - 1 ) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' End Function
|
|