<object id="agobjorasession" runat="server" progid="oracleinprocserver.xorasession" scope="application">
</object>
<script language=vbscript runat=server>
const const_fl_name = "\getattributecode.ini"
const const_fl_forreading = 1
const const_db_section = "[db_connection]"sub application_onstart
on error resume next
dim objfs
dim objts
dim strlinedata
dim flgsection
dim strtempdata
application("service") = ""
application("user") = ""
strlinedata = ""
strtempdata = ""
flgsection = false
set objfs = server.createobject ("scripting.filesystemobject")
set objts = objfs.opentextfile(server.mappath(const_fl_name),const_fl_forreading,false)
if err.number <> 0 then
err.clear
set objts = nothing
set objfs = nothing
exit sub
end if
while not objts.atendofstream
strlinedata = objts.readline
if trim(strlinedata) <> "" then
if flgsection = true and mid(strlinedata,1,1) = "[" and _
mid(strlinedata,len(strlinedata),1) = "]" then
objts.close
set objts = nothing
set objfs = nothing
exit sub
end if
if strlinedata = const_db_section then
flgsection = true
end if
if flgsection = true then
if mid(strlinedata,1,7) = "service" then
strtempdata = trim(mid(strlinedata,8,len(strlinedata)-7))
if mid(strtempdata,1,1) = "=" then
strtempdata = trim(mid(strtempdata,2,len(strtempdata)-1))
application.lock
application("service") = mid(strtempdata,2,len(strtempdata)-2)
application.unlock
end if
end if
if mid(strlinedata,1,4) = "user" then
strtempdata = trim(mid(strlinedata,5,len(strlinedata)-4))
if mid(strtempdata,1,1) = "=" then
strtempdata = trim(mid(strtempdata,2,len(strtempdata)-1))
application.lock
application("user") = mid(strtempdata,2,len(strtempdata)-2)
application.unlock
end if
end if
end if
end if
wend
objts.close
set objts = nothing
set objfs = nothing
end sub
</script>
[1]
发表评论