Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.08 KB

sample_005.md

File metadata and controls

47 lines (32 loc) · 1.08 KB

主页

获取系统和 Windows 文件夹名称

翻译:xinjie 2020.12.31

开始之前:

参考:


代码:

DECLARE INTEGER GetWindowsDirectory IN kernel32;
	STRING @lpBuffer, INTEGER nSize

DECLARE INTEGER GetSystemDirectory IN kernel32;
	STRING @ lpBuffer, INTEGER nSize

LOCAL lpBuffer, nSizeRet

lpBuffer = SPACE (250)
nSizeRet = GetSystemDirectory(@lpBuffer, Len(lpBuffer))
lpBuffer = SUBSTR (lpBuffer, 1, nSizeRet)
? lpBuffer

lpBuffer = SPACE (250)
nSizeRet = GetWindowsDirectory(@lpBuffer, Len(lpBuffer))
lpBuffer = SUBSTR (lpBuffer, 1, nSizeRet)
? lpBuffer  

函数列表:

GetSystemDirectory
GetWindowsDirectory

备注:

? GetEnv("windir")