by Yuening Dai (30 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Fri 13th October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
MyInfo Component Sample
<HTML>
<HEAD>
<TITLE>ASP 2.0 Demo - The MyInfo Component </TITLE>
</HEAD>
<BODY>
<H2>ASP 2.0 Demo - The MyInfo Component </H2>
<HR>
The <B>MyInfo Component</B> can be used to keep track of personal information, provided by the server administrator.
<P>
This component is implemented in <B>MYINFO.DLL.</B>
<P>At the begining, you may have nothing in the MyInfo for some properties, but you can add your own and modify them.
<P>
<B><font color=blue>How to: You can click the Reload or Refresh menu button to see the result.</font></B>
<HR>
<P>
<%
Dim objMyInfo
On Error Resume Next
Set objMyInfo=Server.CreateObject("MSWC.MyInfo")
If IsObject(objMyInfo)=False Then
Response.Write "The MyInfo object can not be created on this machine. Either you do not "
Response.Write "have this component on the server machine or it is not installed properly."
Response.Write "You may try to fix this problem by installing IIS Resource Kit."
Else
Response.Write "The MyInfo object is created successfully !<P>"
Response.Write "Before I change my info, I have following:<BR>"
Response.Write("<BR>My favorite color is - " + objMyInfo.FavoriteColor)
Response.Write("<BR>My startdate is - " + objMyInfo.StartDate)
Response.Write("<BR>My email address is - " + objMyInfo.Email)
Response.Write("<BR>Last time MyInfo was reset is - " + objMyInfo.MyInfoReset)
'
' Reset my info.
If objMyInfo.FavoriteColor="blue" Then
objMyInfo.FavoriteColor="purple"
Else
objMyInfo.FavoriteColor="blue"
End if
'
If objMyInfo.StartDate="1/1/1999" Then
objMyInfo.StartDate="1/1/2000"
Else
objMyInfo.StartDate="1/1/1999"
End If
'
If objMyInfo.Email="[email protected]" Then
objMyInfo.Email="[email protected]"
Else
objMyInfo.Email="[email protected]"
End if
'
objMyInfo.MyInfoReset=Now
'
' Display new values.
Response.Write "<P>After I change my info, I have following:<BR>"
Response.Write("<BR>My new favorite color is - " + objMyInfo.FavoriteColor)
Response.Write("<BR>My new startdate is - " + objMyInfo.StartDate)
Response.Write("<BR>My new email address is - " + objMyInfo.Email)
End if
%>
<P>
</BODY>
</HTML>