如何读取a.Ini文件




const const_fl_name = getattributecode INI
const const_fl_forreading = 1
const const_db_section ={ db_connection }子application_onstart
下次继续出错

昏暗的objfs
昏暗的objts
昏暗的strlinedata
昏暗的flgsection
昏暗的strtempdata

应用程序(服务)
应用程序(用户)
strlinedata =
strtempdata =
flgsection = false


集objfs = server.createobject(脚本。FileSystemObject )
集objts = objfs.opentextfile(server.mappath(const_fl_name),const_fl_forreading,假)
如果错误,数字<0,然后
呃。清晰
集objts =没有
集objfs =没有
退出子
最后如果

而不是objts.atendofstream
strlinedata = objts.readline
如果修剪(strlinedata)<>然后
如果flgsection =真正的中期(strlinedata,1,1)= 和_
中期(strlinedata,Len(strlinedata),1)=}然后
objts。关闭
集objts =没有
集objfs =没有
退出子
最后如果

如果strlinedata = const_db_section然后
flgsection =真
如果flgsection =真
如果中期(strlinedata,1,7)=服务,然后
strtempdata =装饰(MID(strlinedata,8,Len(strlinedata)- 7))
如果中期(strtempdata,1,1)==然后
strtempdata =装饰(MID(strtempdata,2,Len(strtempdata)- 1))
锁的应用。
应用(服务)=中(strtempdata,2,Len(strtempdata)- 2)
application.unlock
最后如果
最后如果
如果中期(strlinedata,1,4)=用户
strtempdata =装饰(MID(strlinedata,5,Len(strlinedata)- 4))
If Mid (strTempData, 1,1) = = Then
strtempdata =装饰(MID(strtempdata,2,Len(strtempdata)- 1))
锁的应用。
应用(用户)=中(strtempdata,2,Len(strtempdata)- 2)
application.unlock
最后如果
最后如果
最后如果
最后如果

objts。关闭
集objts =没有
集objfs =没有
端子


{ 1 }