MyInfo Component Properties

Each property of a MyInfo object returns a string. If a MyInfo property has no value set, the property returns an empty string.

The MyInfo object can have properties in addition to the ones documented here. You can create new MyInfo properties by simply assigning a string value to them. For example:

<% 
  MyInfoObject.DogName = "Snoopy" 
  MyInfoObject.DogBreed = "Beagle" 
%> 
 

The above code creates the new properties DogName and DogBreed. These new properties are stored persistently along with the other MyInfo properties in a single text file called MyInfo.xml.  For Windows95 and Windows98, MyInfo.xml is stored in the root directory.  For Windows 2000 and later, MyInfo.xml is stored in the %SystemDrive%\system32\inetsrv\Data folder. If you move the MyInfo.xml file to another server, custom properties will not be implemented.

Only create new MyInfo properties for values that remain consistent throughout a site.



Syntax

Var = MyInfoObject.Property

MyInfoObject.Property = NewVar

 

The MyInfo component has the following properties:

PageType Returns a number corresponding to the value in the "This site is ..." pop-up menu. These are the pop-up menu options with their corresponding numerical values:
1 = About My Company
2 = About My Life
3 = About My School
4 = About My Organization
5 = About My Community
PersonalName Returns the owner's name.
PersonalAddress Returns the owner's address.
PersonalPhone Returns the owner's phone number.
PersonalMail Returns the owner's e-mail address.
PersonalWords Returns additional text associated with the owner.
CompanyName Returns the name of the owner's company.
CompanyAddress Returns the address of the owner's company.
CompanyPhone Returns the phone number of the owner's company.
CompanyDepartment Returns the owner's department name.
CompanyWords Returns additional text associated with the owner's company.
HomeOccupation Returns the owner's occupation.
HomePeople Returns text listing the people the owner lives with.
HomeWords Returns additional text associated with the owner.
SchoolName Returns the name of the owner's school.
SchoolAddress Returns the address of the owner's school.
SchoolPhone Returns the phone number of the owner's school.
SchoolDepartment Returns the owner's department or class.
SchoolWords Returns text associated with the owner's school.
OrganizationName Returns the name of the organization featured on the site.
OrganizationAddress Returns the address of the organization.
OrganizationPhone Returns the phone number of the organization.
OrganizationWords Returns text describing the organization.
CommunityName Returns the name of the community featured on the site.
CommunityLocation Returns the location of the community.
CommunityPopulation Returns the population of the community.
CommunityWords Returns text describing the community.
URL(n) Returns the nth user-defined URL. Corresponds to the nth link description in URLWords.
URLWords(n) Returns a string containing the nth user-defined description of a link. Corresponds to the nth URL in URL.
Style Returns the relative URL (starting with '/') of a style sheet.
Background Returns the background for the site.
Title Returns the user-defined title for the home page.
Guestbook Returns –1 if the guest book should be available on the site. Otherwise, returns 0. The default value is "".
Messages Returns –1 if the private message form should be available on the site. Otherwise, returns 0. The default value is "".

Example

This example gets all the MyInfo properties if they exist, and allows the user to set them.  This is a very large example, but may be used as a tool.

--- MyInfo.asp ---

<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>

<% 'Get all the inputs from the Form
If Not "" = Request.Form("PageFile") Then MyInfoObject.PageFile = Request.Form("PageFile")
If Not "" = Request.Form("PersonalName") Then MyInfoObject.PersonalName = Request.Form("PersonalName")
If Not "" = Request.Form("PersonalAddress") Then MyInfoObject.PersonalAddress = Request.Form("PersonalAddress")
If Not "" = Request.Form("PersonalPhone") Then MyInfoObject.PersonalPhone = Request.Form("PersonalPhone")
If Not "" = Request.Form("PersonalMail") Then MyInfoObject.PersonalMail = Request.Form("PersonalMail")
If Not "" = Request.Form("PersonalWords") Then MyInfoObject.PersonalWords = Request.Form("PersonalWords")
If Not "" = Request.Form("CompanyName") Then MyInfoObject.CompanyName = Request.Form("CompanyName")
If Not "" = Request.Form("CompanyAddress") Then MyInfoObject.CompanyAddress = Request.Form("CompanyAddress")
If Not "" = Request.Form("CompanyPhone") Then MyInfoObject.CompanyPhone = Request.Form("CompanyPhone")
If Not "" = Request.Form("CompanyDepartment") Then MyInfoObject.CompanyDepartment = Request.Form("CompanyDepartment")
If Not "" = Request.Form("CompanyWords") Then MyInfoObject.CompanyWords = Request.Form("CompanyWords")
If Not "" = Request.Form("HomeOccupation") Then MyInfoObject.HomeOccupation = Request.Form("HomeOccupation")
If Not "" = Request.Form("HomePeople") Then MyInfoObject.HomePeople = Request.Form("HomePeople")
If Not "" = Request.Form("HomeWords") Then MyInfoObject.HomeWords = Request.Form("HomeWords")
If Not "" = Request.Form("SchoolName") Then MyInfoObject.SchoolName = Request.Form("SchoolName")
If Not "" = Request.Form("SchoolAddress") Then MyInfoObject.SchoolAddress = Request.Form("SchoolAddress")
If Not "" = Request.Form("SchoolPhone") Then MyInfoObject.SchoolPhone = Request.Form("SchoolPhone")
If Not "" = Request.Form("SchoolDepartment") Then MyInfoObject.SchoolDepartment = Request.Form("SchoolDepartment")
If Not "" = Request.Form("SchoolWords") Then MyInfoObject.SchoolWords = Request.Form("SchoolWords")
If Not "" = Request.Form("OrganizationName") Then MyInfoObject.OrganizationName = Request.Form("OrganizationName")
If Not "" = Request.Form("OrganizationAddress") Then MyInfoObject.OrganizationAddress = Request.Form("OrganizationAddress")
If Not "" = Request.Form("OrganizationPhone") Then MyInfoObject.OrganizationPhone = Request.Form("OrganizationPhone")
If Not "" = Request.Form("OrganizationWords") Then MyInfoObject.OrganizationWords = Request.Form("OrganizationWords")
If Not "" = Request.Form("CommunityName") Then MyInfoObject.CommunityName = Request.Form("CommunityName")
If Not "" = Request.Form("CommunityLocation") Then MyInfoObject.CommunityLocation = Request.Form("CommunityLocation")
If Not "" = Request.Form("CommunityPopulation") Then MyInfoObject.CommunityPopulation = Request.Form("CommunityPopulation")
If Not "" = Request.Form("CommunityWords") Then MyInfoObject.CommunityWords = Request.Form("CommunityWords")
If Not "" = Request.Form("Style") Then MyInfoObject.Style = Request.Form("Style")
If Not "" = Request.Form("Background") Then MyInfoObject.Background = Request.Form("Background")
If Not "" = Request.Form("Title") Then MyInfoObject.Title = Request.Form("Title")
If Not "" = Request.Form("Guestbook") Then MyInfoObject.Guestbook = Request.Form("Guestbook")
If Not "" = Request.Form("Messages") Then MyInfoObject.Messages = Request.Form("Messages")

' MyInfoObject.URL and URLWords are not exactly arrays.
If Not "" = Request.Form("URL") Then
  If Instr(Request.Form("URL"), ";") Then 
    aURL = Split(Request.Form("URL"), ";")
    For i = 0 to UBound(aURL)
      MyInfoObject.URL(i) = aURL(i)
    Next
    MyInfoObject.TotalURL = i
  Else
    MyInfoObject.URL(1) = Request.Form("URL")
    MyInfoObject.TotalURL = 1
  End If
End If
If Not "" = Request.Form("URLWords") Then 
  If Instr(Request.Form("URLWords"), ";") Then 
    aURLWords = Split(Request.Form("URLWords"), ";")
    For i = 0 to UBound(aURLWords)
      MyInfoObject.URLWords(i) = aURLWords(i)
    Next
    MyInfoObject.TotalURLWords = i
  Else
    MyInfoObject.URLWords(1) = Request.Form("URLWords")
    MyInfoObject.TotalURL = 1
  End If
End If

' Now, get the inputs from the user with a FORM
%>

<H3>Set Your MyInfo Data</H3>
<H4>This data will be saved in %SystemDrive%\system32\inetsrv\Data\MyInfo.xml</H4> 

<FORM NAME="GetAndSetMyInfo" METHOD="POST" ACTION="MyInfo.asp">
<TABLE><TR>
<TD>PageFile</TD>
<TD><select NAME="PageFile">
    <option value=1 <% If 1=MyInfoObject.PageFile Then Response.Write "SELECTED"%>>About My Company</option>
    <option value=2 <% If 2=MyInfoObject.PageFile Then Response.Write "SELECTED"%>>About My Life</option>
    <option value=3 <% If 3=MyInfoObject.PageFile Then Response.Write "SELECTED"%>>About My School</option>
    <option value=4 <% If 4=MyInfoObject.PageFile Then Response.Write "SELECTED"%>>About My Organization</option>
    <option value=5 <% If 5=MyInfoObject.PageFile Then Response.Write "SELECTED"%>>About My Community</option>
</select></TD>
</TR><TR>
<TD>PersonalName</TD>
<TD><input type="TEXT" NAME="PersonalName" value="<%=MyInfoObject.PersonalName%>" size=35></TD>
</TR><TR>
<TD>PersonalAddress</TD>
<TD><input type="TEXT" NAME="PersonalAddress" value="<%=MyInfoObject.PersonalAddress%>" size=35></TD>
</TR><TR>
<TD>PersonalPhone</TD>
<TD><input type="TEXT" NAME="PersonalPhone" value="<%=MyInfoObject.PersonalPhone%>" size=35></TD>
</TR><TR>
<TD>PersonalMail</TD>
<TD><input type="TEXT" NAME="PersonalMail" value="<%=MyInfoObject.PersonalMail%>" size=35></TD>
</TR><TR>
<TD>PersonalWords</TD>
<TD><input type="TEXT" NAME="PersonalWords" value="<%=MyInfoObject.PersonalWords%>" size=35></TD>
</TR><TR>
<TD>CompanyName</TD>
<TD><input type="TEXT" NAME="CompanyName" value="<%=MyInfoObject.CompanyName%>" size=35></TD>
</TR><TR>
<TD>CompanyAddress</TD>
<TD><input type="TEXT" NAME="CompanyAddress" value="<%=MyInfoObject.CompanyAddress%>" size=35></TD>
</TR><TR>
<TD>CompanyPhone</TD>
<TD><input type="TEXT" NAME="CompanyPhone" value="<%=MyInfoObject.CompanyPhone%>" size=35></TD>
</TR><TR>
<TD>CompanyDepartment</TD>
<TD><input type="TEXT" NAME="CompanyDepartment" value="<%=MyInfoObject.CompanyDepartment%>" size=35></TD>
</TR><TR>
<TD>CompanyWords</TD>
<TD><input type="TEXT" NAME="CompanyWords" value="<%=MyInfoObject.CompanyWords%>" size=35></TD>
</TR><TR>
<TD>HomeOccupation</TD>
<TD><input type="TEXT" NAME="HomeOccupation" value="<%=MyInfoObject.HomeOccupation%>" size=35></TD>
</TR><TR>
<TD>HomePeople</TD>
<TD><input type="TEXT" NAME="HomePeople" value="<%=MyInfoObject.HomePeople%>" size=35></TD>
</TR><TR>
<TD>HomeWords</TD>
<TD><input type="TEXT" NAME="HomeWords" value="<%=MyInfoObject.HomeWords%>" size=35></TD>
</TR><TR>
<TD>SchoolName</TD>
<TD><input type="TEXT" NAME="SchoolName" value="<%=MyInfoObject.SchoolName%>" size=35></TD>
</TR><TR>
<TD>SchoolAddress</TD>
<TD><input type="TEXT" NAME="SchoolAddress" value="<%=MyInfoObject.SchoolAddress%>" size=35></TD>
</TR><TR>
<TD>SchoolPhone</TD>
<TD><input type="TEXT" NAME="SchoolPhone" value="<%=MyInfoObject.SchoolPhone%>" size=35></TD>
</TR><TR>
<TD>SchoolDepartment</TD>
<TD><input type="TEXT" NAME="SchoolDepartment" value="<%=MyInfoObject.SchoolDepartment%>" size=35></TD>
</TR><TR>
<TD>SchoolWords</TD>
<TD><input type="TEXT" NAME="SchoolWords" value="<%=MyInfoObject.SchoolWords%>" size=35></TD>
</TR><TR>
<TD>OrganizationName</TD>
<TD><input type="TEXT" NAME="OrganizationName" value="<%=MyInfoObject.OrganizationName%>" size=35></TD>
</TR><TR>
<TD>OrganizationAddress</TD>
<TD><input type="TEXT" NAME="OrganizationAddress" value="<%=MyInfoObject.OrganizationAddress%>" size=35></TD>
</TR><TR>
<TD>OrganizationPhone</TD>
<TD><input type="TEXT" NAME="OrganizationPhone" value="<%=MyInfoObject.OrganizationPhone%>" size=35></TD>
</TR><TR>
<TD>OrganizationWords</TD>
<TD><input type="TEXT" NAME="OrganizationWords" value="<%=MyInfoObject.OrganizationWords%>" size=35></TD>
</TR><TR>
<TD>CommunityName</TD>
<TD><input type="TEXT" NAME="CommunityName" value="<%=MyInfoObject.CommunityName%>" size=35></TD>
</TR><TR>
<TD>CommunityLocation</TD>
<TD><input type="TEXT" NAME="CommunityLocation" value="<%=MyInfoObject.CommunityLocation%>" size=35></TD>
</TR><TR>
<TD>CommunityPopulation</TD>
<TD><input type="TEXT" NAME="CommunityPopulation" value="<%=MyInfoObject.CommunityPopulation%>" size=35></TD>
</TR><TR>
<TD>CommunityWords</TD>
<TD><input type="TEXT" NAME="CommunityWords" value="<%=MyInfoObject.CommunityWords%>" size=35></TD>
</TR><TR>
<TD>Style</TD>
<TD><input type="TEXT" NAME="Style" value="<%=MyInfoObject.Style%>" size=35></TD>
</TR><TR>
<TD>Background</TD>
<TD><input type="TEXT" NAME="Background" value="<%=MyInfoObject.Background%>" size=35></TD>
</TR><TR>
<TD>Title</TD>
<TD><input type="TEXT" NAME="Title" value="<%=MyInfoObject.Title%>" size=35></TD>
</TR><TR>
<TD>Guestbook</TD>
<TD><select NAME="Guestbook">
    <option value=-1 <% If -1=MyInfoObject.Guestbook Then Response.Write "SELECTED"%>>Make Available</option>
    <option value=0 <% If 0=MyInfoObject.Guestbook Then Response.Write "SELECTED"%>>Do Not Make Available</option>
</select></TD>
</TR><TR>
<TD>Messages</TD>
<TD><select NAME="Messages">
    <option value=-1 <% If -1=MyInfoObject.Messages Then Response.Write "SELECTED"%>>Make Available</option>
    <option value=0 <% If 0=MyInfoObject.Messages Then Response.Write "SELECTED"%>>Do Not Make Available</option>
</select></TD>
</TR><TR>

<%
strURL = ""
If Not 0 = MyInfoObject.TotalURL Then
  For i = 0 to (MyInfoObject.TotalURL-1)
    strURL = strURL & MyInfoObject.URL(i)
    If Not (MyInfoObject.TotalURL-1) = i Then strURL = strURL & ";"
  Next
End If

strURLWords = ""
If Not 0 = MyInfoObject.TotalURLWords Then
  For i = 0 to (MyInfoObject.TotalURLWords-1)
    strURLWords = strURLWords & MyInfoObject.URLWords(i)
    If Not (MyInfoObject.TotalURLWords-1) = i Then strURLWords = strURLWords & ";"
  Next
End If
%>

<TD>URL seperated by ;</TD>
<TD><input type="TEXT" NAME="URL" value="<%=strURL%>" size=35></TD>
</TR><TR>
<TD>URLWords seperated by ;</TD>
<TD><input type="TEXT" NAME="URLWords" value="<%=strURLWords%>" size=35></TD>

</TR>
</TABLE><BR>
<INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>

</BODY>
</HTML>

© 1997-2001 Microsoft Corporation. All rights reserved.