首 页 | 模 板 | 学 院 | 源 码 | 书 籍 | 壁 纸 | 字 体 | JS脚本 | FLASH源码 | 软 件 | 矢 量 | 服务器软件 | 素 材 | 其 它 |
设为主页
加入收藏
联系站长
平面设计 | 网页制作 | 程序编写 | 数 据 库 | 媒体动画 | 网络冲浪 | 服务器相关 | 站长乐园 | 业界动态 |
当前在线
返回服务器信息
2006-6-27 8:34:39  作者:模板天下收集整理  来源:未知 网友评论 0 条 论坛
  '函数名:GetServerInfo
'作  用:返回服务器信息
'参  数:Lx ---- 返回信息代码类
' 0 : 服务器的域名
' 1 : 服务器的IP地址
' 2 : 服务器操作系统
' 3 : 服务器解译引擎
' 4 : 服务器软件的名称及版本
' 5 : 服务器正在运行的端口
' 6 : 服务器CPU数量
' 7 : 服务器Application数量
' 8 : 服务器Session数量
' 9 : 请求的物理路径
'10 : 请求的URL
'11 : 服务器当前时间
'12 : 脚本连接超时时间
'13 : 服务器CPU详情
'14 :
'返回值:返回信息字串
'示  例:GetServerInfo(2)
'**************************************************
Public Function GetServerInfo(ByVal Lx)
  GetServerInfo=""
  Dim okCPUS, okCPU, okOS
  on error resume next
  Set WshShell = server.CreateObject("WScript.Shell")
  Set WshSysEnv = WshShell.Environment("SYSTEM")
  okOS = cstr(WshSysEnv("OS"))
  okCPUS = cstr(WshSysEnv("NUMBER_OF_PROCESSORS"))
  okCPU = cstr(WshSysEnv("PROCESSOR_IDENTIFIER"))
  if isnull(okCPUS) & "" = "" then
    okCPUS = Request.ServerVariables("NUMBER_OF_PROCESSORS")
  end if
  tnow = now():oknow = cstr(tnow)
  if oknow <> year(tnow) & "-" & month(tnow) & "-" & day(tnow) & " " & hour(tnow) & ":" & right(FormatNumber(minute(tnow)/100,2),2) & ":" & right(FormatNumber(second(tnow)/100,2),2) then oknow = oknow & " (日期格式不规范)"
  If Lx=0  Then GetServerInfo=Request.ServerVariables("server_name")
  If Lx=1  Then GetServerInfo=Request.ServerVariables("LOCAL_ADDR")
  If Lx=2  Then GetServerInfo=okOS     ''  Request.ServerVariables("OS")
  If Lx=3  Then GetServerInfo=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion
  If Lx=4  Then GetServerInfo=Request.ServerVariables("SERVER_SOFTWARE")
  If Lx=5  Then GetServerInfo=Request.ServerVariables("server_port")
  If Lx=6  Then GetServerInfo=okCPUS   ''  Request.ServerVariables("NUMBER_OF_PROCESSORS")
  If Lx=7  Then GetServerInfo=Application.Contents.Count
  If Lx=8  Then GetServerInfo=Session.Contents.Count
  If Lx=9  Then GetServerInfo=Request.ServerVariables("path_translated")
  If Lx=10 Then GetServerInfo=Request.ServerVariables("server_name")&Request.ServerVariables("script_name")
  If Lx=11 Then GetServerInfo=oknow
  If Lx=12 Then GetServerInfo=Server.ScriptTimeout
  If Lx=13 Then GetServerInfo=okCPU
End Function
>> 相关文章

关于网站 | 客服中心 | 服务条款 | 友情链接 | 广告联系 | 本站历程 | 网站导航

吉ICP备05000107号