回复 13楼 琅拿度
文件操作的API有不少
如:
*方法一
DECLARE LONG CreateFile IN Kernel32 STRING@, LONG, LONG, LONG, LONG, LONG, LONG
DECLARE LONG GetFileSize IN Kernel32 LONG, LONG
DECLARE LONG CloseHandle IN Kernel32 LONG
hFile = CreateFile("C:\TEMP\test.txt", 8, 1, 0, 3, 0, 0)
IF (hFIle != -1)
nSize = GetFileSize(hFile, 0)
? nSize
CloseHandle(hFile)
ENDIF
*方法二
DECLARE LONG FindFirstFile IN Kernel32 STRING@, STRING@
DECLARE LONG FindClose IN Kernel32 LONG
stFI = REPLICATE(0h00, 320)
hFile = FindFirstFile("C:\TEMP\test.txt" , @stFI)
IF (hFIle != -1)
nSize = CTOBIN(SUBSTR(stFI,33,4), "4RS")
? nSize
FindClose(hFile)
ENDIF