<%
Sub IniFileLoad(ByVal FilSpc)
FilSpc = lcase(FilSpc)
dim PhyPth
if left(FilSpc, 1) = "p" then
'Physical path
PhyPth = mid(FilSpc, instr(FilSpc, "=") + 1)
else
'Virtual path
PhyPth = Server.MapPath(mid(FilSpc, instr(FilSpc, "=") + 1))
end if
dim FilSys,IniFil
set FilSys = CreateObject("Scripting.FileSystemObject")
set IniFil = FilSys.OpenTextFile(PhyPth, 1)
dim StrBuf
dim HdrBuf
dim StrPtr
dim AltBuf
do while not IniFil.AtEndOfStream
StrBuf = IniFil.ReadLine
if StrBuf <> "" then
if left(StrBuf, 1) <> "<" then
'There is data on this line
if left(StrBuf, 1) <> ";" then
'It's not a comment
if left(StrBuf, 1) = "[" then
'It's a section header
HdrBuf = mid(StrBuf, 2, len(StrBuf) - 2)
else
'It's a value
StrPtr = instr(StrBuf, "=")
if(StrPtr>0) then
AltBuf = lcase(HdrBuf & "|" & left(StrBuf, StrPtr - 1))
session(trim(AltBuf))=trim(mid(StrBuf, StrPtr + 1))
end if
end if
end if
end if
end if
loop
IniFil.Close
set IniFil = nothing
set FilSys = nothing
End Sub
%>
<%
dim odbc,dbname,UID,PWD,dbserver
if isnull(session("db|odbc")) or session("db|odbc")="" then
call IniFileLoad("virtual=db_ini.asp")
end if
odbc = session("db|odbc")
dbname=session("db|dbname") '数据库用户口令
UID=session("db|UID") '数据库名
PWD=session("db|PWD") '数据库所在的IP地址
dbserver=session("db|dbserver") '数据库所在的IP地址
%>
<%
session("bRateOption") = true '费率类型
session("bNumber") = true '接入号和主叫规则
%>
文件
<%
response.end
[db]
odbc = false
dbname = callback
UID = callback
PWD = callback852456
dbserver = 127.0.0.1
sp = callback
ip = D7AA6C56E87823A2FE231ADE6E761640
%>