数据用户名读取文件

<%
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
%> 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值