ASP Variables for Print Web Pages
Microsoft provides a set of ASP session variables for use by customized print Web pages. The following table lists the session variables. Customized ASP files must not modify these variables. As indicated, some variables are only valid if Microsoft's TCP/IP port monitor is being used for the printer.
Some variables are passed in as session variables, while others are passed in using URL decoration. Session variables can be accessed by using Session("VariableName"). Parameters passed in by URL decoration can be accessed by using Request("VariableName"). If you wish to automatically refresh the status page, you might find it necessary to redecorate the URL with the variables your page requires. Since Request variables must be passed in the URL, they may require encoding and decoding to translate from ANSI to Unicode representation. A helper object, whose COM ProgID is "OlePrn.OleCvt", has been provided to enable encoding and decoding between the ANSI used in the URL and Unicode. Two methods on this object, IOleCvt::EncodeUnicodeName, and IOleCvt::DecodeUnicodeName, can be used to translate from ANSI to Unicode, and from Unicode to ANSI, respectively. This conversion does not need to be performed for Session variables.
Variable Value TCP/IP Port Variable Encoded? Monitor Only? Type MS_ASP1
Directory path to the initial Web page used for describing printer-specific details.
No
Request
No
MS_Community
The print server's SNMP community name.
Yes
Request
No
MS_Computer
The print server's computer name.
No
Session
No
MS_DefaultPage
The default ASP file for printer-specific details.
No
Session
No
MS_Device
The printer's SNMP device index.
Yes
Request
No
MS_DHTMLEnabled
TRUE if the client supports dynamic HTML; otherwise FALSE.
No
Session
No
MS_IPAddress
The printer's IP address.
Yes
Request
No
MS_LocalServer
The print server's identifier. This might be either an IP address or a computer name.
No
Session
No
MS_Model
The name of the printer driver.
No
Request
Yes
MS_Portname
The printer's port name.
No
Request
Yes
MS_Printer
The printer's name.
No
Request
Yes
MS_SNMP
TRUE if SNMP is being used with a printer, otherwise FALSE.
Yes
Request
No
MS_URLPrinter
The printer's name, in encoded URL format.
No
Request
Yes
The session variables specify properties of the "current" printer, that is, the printer for which an ASP page was invoked. To obtain additional printer properties for the current printer, or to obtain properties of a different printer, see ActiveX Objects for Print Web Pages.