返回操作系统的临时目录,系统目录,WINDOWS目录
时 间:2004-11-18 00:00:00
作 者:黄海 ID:32 城市:苏州
摘 要:返回操作系统的临时目录,系统目录,WINDOWS目录
正 文:
'******************** Code Start **************************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Const MAX_PATH As Integer = 255
Private Declare Function apiGetSystemDirectory& Lib "kernel32" _
Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long)
Private Declare Function apiGetWindowsDirectory& Lib "kernel32" _
Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long)
Private Declare Function apiGetTempDir Lib "kernel32" _
Alias "GetTempPathA" (ByVal nBufferLength As Long, _
ByVal lpBuffer As String) As Long
Function fReturnTempDir()
'Returns Temp Folder Name
Dim strTempDir As String
Dim lngx As Long
strTempDir = String$(MAX_PATH, 0)
lngx = apiGetTempDir(MAX_PATH, strTempDir)
If lngx <> 0 Then
fReturnTempDir = Left$(strTempDir, lngx)
Else
fReturnTempDir = ""
End If
End Function
Function fReturnSysDir()
'Returns System Folder Name (C:\WinNT\System32)
Dim strSysDirName As String
Dim lngx As Long
strSysDirName = String$(MAX_PATH, 0)
lngx = apiGetSystemDirectory(strSysDirName, MAX_PATH)
If lngx <> 0 Then
fReturnSysDir = Left$(strSysDirName, lngx)
Else
fReturnSysDir = ""
End If
End Function
Function fReturnWinDir()
'Returns OS Folder (C:\Win95)
Dim strWinDirName As String
Dim lngx As Long
strWinDirName = String$(MAX_PATH, 0)
lngx = apiGetWindowsDirectory(strWinDirName, MAX_PATH)
If lngx <> 0 Then
fReturnWinDir = Left$(strWinDirName, lngx)
Else
fReturnWinDir = ""
End If
End Function
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 通过命令按钮让Access列表...(04.24)
- 统计当月之前(不含当月)的记录...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- 【Access Inputbo...(12.23)

学习心得
最新文章
- 仓库管理实战课程(15)-月度库存...(04.30)
- Access选择打印机、横纵向、纸...(04.29)
- 仓库管理实战课程(14)-出库功能...(04.26)
- 通过命令按钮让Access列表框指...(04.24)
- 仓库管理实战课程(13)-入库功能...(04.21)
- Access控件美化之--美化按钮...(04.19)
- Access多行文本按指定字符筛选...(04.18)
- Microsoft Access数...(04.18)
- 仓库管理实战课程(12)-月度结存...(04.16)
- 仓库管理实战课程(11)-人性化操...(04.15)