Dim strSubmit 'Form中用来保存提交按钮的值 Dim strPrinterPath 'Form中保存网络打印机路径的值 Dim strUsername 'Form中用户名的值 Dim strPassword 'Form中密码的值 Dim strMessage 'Form打印内容的值 Dim objFS 'VBScript中的文件系统对象 Dim objWSHNet 'WSH中的网络对象 Dim objPrinter '打印对象
strSubmit = Request.Form("Submit") %>
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY>
We will now use the VBScript FileSystemObject object and the WSH Net work object. The Network object will give us the methods we need to open a printer connection, and the Fi leSystemObject will allow us to stream our output to the printer. We create these objects in the following code example:
Response.Write("</TABLE>") Response.Write("</CENTER>") End If ' 取消打印连接 objWSHNet.RemovePrinterConnection "LPT1:" Set objWSHNet = Nothing Set objFS = Nothing Set objPrinter = Nothing End If %> </BODY> </HTML>