118 lines
4.0 KiB
HTML
118 lines
4.0 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>Set</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="_set_counters"></A><SUP></SUP>Set</H2>
|
|
|
|
<P>The <B>Set </B>method takes the name of a counter and an integer, sets the counter to the value of the integer, and returns the new value. If the counter doesn't exist, <B>Counters.Set </B>creates it and sets it to the value of the integer.</P>
|
|
|
|
<P>To retrieve the value of a counter, use <B>Counters.Get</B>. To increment a counter by 1, use <B>Counters.Increment</B>. </P>
|
|
|
|
<H6>Syntax</H6>
|
|
|
|
<P><I>Counters</I><B>.Set( </B><I>CounterName</I><B>, </B><I>int </I><B>)</B></P>
|
|
|
|
<P> </P>
|
|
|
|
<H6>Parameters</H6>
|
|
|
|
<DL>
|
|
<DT><I>CounterName</I></DT>
|
|
|
|
<DD>A string containing the name of the counter.<BR>
|
|
</DD>
|
|
|
|
<DT><I>int</I></DT>
|
|
|
|
<DD>The new integer value for <I>CounterName</I>.</DD>
|
|
</DL>
|
|
|
|
<H6>Example</H6>
|
|
|
|
<P>The following code resets the votes: </P>
|
|
|
|
<P>--- Counters_Set.asp ---</P>
|
|
|
|
<PRE><CODE><HTML>
|
|
<HEAD><TITLE>Voting for Colors</TITLE></HEAD>
|
|
<BODY>
|
|
<%
|
|
red = Request.QueryString("red")
|
|
green = Request.QueryString("green")
|
|
blue = Request.QueryString("blue")
|
|
' The Counters object was instantiated in Global.asa.
|
|
If IsNumeric(red) Then
|
|
Counters.Set "redcounter", red
|
|
End If
|
|
If IsNumeric(green) Then
|
|
Counters.Set "greencounter", green
|
|
End If
|
|
If IsNumeric(blue) Then
|
|
Counters.Set "bluecounter", blue
|
|
End If
|
|
%>
|
|
<H3>Doctor the Vote:</H3>
|
|
<FORM NAME="Doctoring the Vote" METHOD="GET" ACTION="Counters_Set.asp">
|
|
Red <input type="TEXT" NAME="red"><BR>
|
|
Green <input type="TEXT" NAME="green"><BR>
|
|
Blue <input type="TEXT" NAME="blue"><BR>
|
|
<BR><INPUT TYPE="SUBMIT" VALUE="Submit">
|
|
</FORM>
|
|
<H3>Current Vote Tally:</H3>
|
|
Red: <% =Counters.Get("redcounter") %><BR>
|
|
Green: <% = Counters.Get("greencounter") %><BR>
|
|
Blue: <% = Counters.Get("bluecounter") %>
|
|
</BODY>
|
|
</HTML>
|
|
</CODE></PRE>
|
|
|
|
<H6>See Also</H6>
|
|
|
|
<P><A HREF="/iishelp/iis/htm/asp/comp1c37.htm">Get</A>, <A HREF="/iishelp/iis/htm/asp/comp46lv.htm">Increment</A>, <A HREF="/iishelp/iis/htm/asp/comp02cz.htm">Remove</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>
|