103 lines
3.6 KiB
HTML
103 lines
3.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
|
|
<TITLE>Get</TITLE>
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
<!--
|
|
TempString = navigator.appVersion
|
|
if (navigator.appName == "Microsoft Internet Explorer"){
|
|
// Check to see if browser is Microsoft
|
|
if (TempString.indexOf ("4.") >= 0){
|
|
// Check to see if it is IE 4
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
|
|
}
|
|
else {
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
|
|
}
|
|
}
|
|
else if (navigator.appName == "Netscape") {
|
|
// Check to see if browser is Netscape
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
|
|
}
|
|
else
|
|
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
|
|
//-->
|
|
</script>
|
|
<SCRIPT LANGUAGE="VBScript">
|
|
<!--
|
|
Sub Window_OnLoad()
|
|
Dim frmContents
|
|
On Error Resume Next
|
|
If Not Parent Is Nothing Then
|
|
Set frmContents = Parent.Contents
|
|
If Not frmContents Is Nothing Then
|
|
frmContents.Window.TOCSynch_Click
|
|
End If
|
|
End If
|
|
End Sub
|
|
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
|
|
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
|
|
<META NAME="MS.LOCALE" CONTENT="EN-US">
|
|
<META NAME="MS-IT-LOC" Content="Internet Information Services">
|
|
</HEAD>
|
|
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
|
|
<H2><A NAME="_get_counters"></A><SUP></SUP>Get</H2>
|
|
|
|
<P>The <B>Get </B>method takes the name of a counter and returns the current value of the counter. If the counter doesn't exist, the method creates it and sets it to 0.</P>
|
|
|
|
<H6>Syntax</H6>
|
|
|
|
<P><I>Counters</I><B>.Get(</B><I>CounterName</I><B>)</B></P>
|
|
|
|
<P> </P>
|
|
|
|
<H6>Parameters</H6>
|
|
|
|
<DL>
|
|
<DT><I>CounterName</I></DT>
|
|
|
|
<DD>A string containing the name of the counter.</DD>
|
|
</DL>
|
|
|
|
<H6>Example</H6>
|
|
|
|
<P>Display the value of a counter with <CODE><%= Counters.Get(<I>CounterName</I>) %></CODE>. The following script displays the vote tally from a poll about favorite colors. </P>
|
|
|
|
<P>--- Counters_Get.asp ---</P>
|
|
|
|
<PRE><CODE><HTML>
|
|
<HEAD><TITLE>Voting for Colors</TITLE></HEAD>
|
|
<BODY>
|
|
|
|
<%
|
|
vote = Request.QueryString("color")
|
|
' The Counters object was instantiated in Global.asa.
|
|
Counters.Increment(vote & "counter")
|
|
%>
|
|
<H3>Vote for your Favorite Color:</H3>
|
|
<FORM NAME="Voting for Colors" METHOD="GET" ACTION="Counters_Get.asp">
|
|
<input type="RADIO" NAME="color" VALUE="red">Red
|
|
<input type="RADIO" NAME="color" VALUE="green">Green
|
|
<input type="RADIO" NAME="color" VALUE="blue">Blue
|
|
<BR><INPUT TYPE="SUBMIT" VALUE="Submit Vote">
|
|
</FORM>
|
|
<H3>Current Vote Tally:</H3>
|
|
Red: <% =Counters.Get("redcounter") %><BR>
|
|
Green: <% = Counters.Get("greencounter") %><BR>
|
|
Blue: <% = Counters.Get("bluecounter") %><BR>
|
|
</BODY>
|
|
</HTML>
|
|
|
|
</CODE></PRE>
|
|
|
|
<H6>See Also</H6>
|
|
|
|
<P><A HREF="/iishelp/iis/htm/asp/comp46lv.htm"><B>Increment</B></A>, <A HREF="/iishelp/iis/htm/asp/comp02cz.htm"><B>Remove</B></A>, <A HREF="/iishelp/iis/htm/asp/comp1q0j.htm"><B>Set</B></A> </P>
|
|
<hr class="iis" size="1">
|
|
<p align="center"><em><a href="../../../common/colegal.htm">© 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
|
|
</BODY>
|
|
</HTML>
|