当前位置: 代码迷 >> VFP >> 怎么设置vfp的临时文件夹
  详细解决方案

怎么设置vfp的临时文件夹

热度:7332   发布时间:2013-02-26 00:00:00.0
如何设置vfp的临时文件夹
我在设置中设置了临时文件夹="d:\temp"
我在config.fpw文件中已设置了临时文件夹 TMPFILES="d:\temp"
编译后,运行程序查看时,却没有设置成功,又变成默认了,请教高手应该如何设置临时文件夹。

------解决方案--------------------------------------------------------
config.fpw加入项目中没有,如果没有,你的设置无效
------解决方案--------------------------------------------------------
我觉得,楼主应该直接把目的说清楚,不知道楼主的目的是什么?我经常用这段代码,贴出来,看对楼主是否有用?

 
 * ------------------------------------------------- \\ 获得当前目录、系统目录
 
DECLARE LONG GetSystemDirectory IN WIN32API STRING @ , LONG 
DECLARE LONG GetWindowsDirectory IN WIN32API STRING @ , LONG 
DECLARE LONG GetCurrentDirectory IN WIN32API LONG , STRING @
public LCSYSDIR , LCWINDIR , LCCURDIR , LNSTRINGLEN,n_dy
 
LCSYSDIR = SPACE(200) + CHR(0)
LCWINDIR = SPACE(200) + CHR(0)
LCCURDIR = SPACE(200) + CHR(0)
LNSTRINGLEN = GETSYSTEMDIRECTORY(@LCSYSDIR,200)
LCSYSDIR = LEFT(LCSYSDIR,LNSTRINGLEN)
LNSTRINGLEN = GETWINDOWSDIRECTORY(@LCWINDIR,200)
LCWINDIR = LEFT(LCWINDIR,LNSTRINGLEN)
LNSTRINGLEN = GETCURRENTDIRECTORY(200,@LCCURDIR)
LCCURDIR = LEFT(LCCURDIR,LNSTRINGLEN)

* ---------------------------------------------------------------- \\ 添加临时目录

PUBLIC M_DISK , M_TEMP_PATH
set defa to &lccurdir
_SCREEN.WINDOWSTATE = 1
AA = 'c:\windows'
if directory('&aa')<>.t.
AA = 'c:\winnt'
if directory('&aa')<>.t.
DECLARE INTEGER CreateDirectory IN kernel32 STRING , INTEGER 
DECLARE INTEGER GetLastError IN kernel32
LPSECURITYATTRIBUTES = 0
LPPATHNAME = AA
IF CREATEDIRECTORY(LPPATHNAME,LPSECURITYATTRIBUTES) = 0
ENDIF 
ENDIF 
ENDIF 
M_TEMP_PATH = AA + '\temps'
if directory('&m_temp_path')<>.t.
DECLARE INTEGER CreateDirectory IN kernel32 STRING , INTEGER 
DECLARE INTEGER GetLastError IN kernel32
LPSECURITYATTRIBUTES = 0
LPPATHNAME = M_TEMP_PATH
IF CREATEDIRECTORY(LPPATHNAME,LPSECURITYATTRIBUTES) = 0
ENDIF 
ENDIF 
TRY

ERASE &m_temp_path\*.*
ERASE *.dbf
CATCH
ENDTRY
  相关解决方案