% '功能:檢查是否存在系統(tǒng)組件或組件是否安裝成功 '參數:組件名 Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then IsObjInstalled = True Set xTestObj = Nothing Err = 0 End Function '獲取系統(tǒng)組件的版本號 Function getver(Classstr) On Error Resume Next getver="" Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(Classstr) If 0 = Err Then getver=xtestobj.version Set xTestObj = Nothing Err = 0 End Function %>
調用方法如下:
復制代碼 代碼如下:
% if IsObjInstalled("fso.file") =True then response.write("已經安裝")getver("fso.file") end if %>