ASP check if the component is already installed

Source: Internet
Author: User

'================================================
' Function: Check if the component is installed
' parameter: strclassstring----Component Name
' Return value: True----already installed
' False----not installed
'================================================
Function isobjinstalled (ByVal strclassstring)
Dim xtestobj,clsstring
On Error Resume Next
isobjinstalled = False
clsstring = strclassstring
ERR = 0
Set xtestobj = Server.CreateObject (clsstring)
If Err = 0 Then isobjinstalled = True
If ERR = -2147352567 Then isobjinstalled = True
Set xtestobj = Nothing
ERR = 0
Exit Function
End Function
Public Sub Getusertodayinfo ()
Dim Lastlogin,userdayinfo
Lastlogin = Request.Cookies ("newasp_net") ("Lasttime")
Userdayinfo = Request.Cookies ("newasp_net") ("Usertoday")
If not IsDate (lastlogin) Then lastlogin = Now ()
On Error Resume Next
If DateDiff ("D", Lastlogin,now ()) <>0 Then
Newasp.execute ("UPDATE [Nc_user] SET usertoday= ' 0,0,0,0,0,0 ', lasttime=" & nowstring & "WHERE username= '" & Newasp.membername & "' and Userid=" & Newasp.memberid)
Userdayinfo = "0,0,0,0,0,0"
Response.Cookies ("Newasp_net") ("usertoday") = Userdayinfo
Response.Cookies ("Newasp_net") ("lasttime") = Now ()
End If
Usertoday = Split (Userdayinfo, ",")
If Ubound (usertoday) <> 5 Then
Newasp.execute ("UPDATE [Nc_user] SET usertoday= ' 0,0,0,0,0,0 ', lasttime=" & nowstring & "WHERE username= '" & Newasp.membername & "' and Userid=" & Newasp.memberid)
Userdayinfo = "0,0,0,0,0,0"
Response.Cookies ("Newasp_net") ("usertoday") = Userdayinfo
Response.Cookies ("Newasp_net") ("lasttime") = Now ()
Usertoday = Split (Userdayinfo, ",")
End If
End Sub

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.