| Получить путь к папке temp |
|
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Public Function GetTempDir() As String 'Возвращает временный каталог On Error Resume Next Dim ls_TempPath As String Dim ll_Buffer As Long Dim li_Length As Integer ll_Buffer = 255 ls_TempPath = Space(255) li_Length = GetTempPath(ll_Buffer, ls_TempPath) If li_Length = 0 Then ls_TempPath = "" ls_TempPath = Environ("TEMP") If ls_TempPath = "" Then ls_TempPath = Environ("TMP") GetTempDir = AddBackSlash(ls_TempPath) Else ls_TempPath = Left(ls_TempPath, li_Length) GetTempDir = AddBackSlash(ls_TempPath) End If End Function Public Function AddBackSlash(ByVal Path$) On Error Resume Next If Right(Path, 1) <> "\" Then Path = Path & "\" AddBackSlash = Path End Function |