国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

用ASP進行網絡、打印的功能

2019-11-02 14:55:55
字體:
來源:轉載
供稿:網友

 <%@ Language=VBScript %>
<%
Option Explicit

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>

<%
If strSubmit = "" Then
%>

注意的是:
由于這是演示,其中有關NT的帳號和密碼都是使用了不加密的手段在asp中傳遞的
真正的運用中應該對該登錄過程進行安全處理。
<FORM action="ASPPrint.asp" method=POST id=form name=form>
<TABLE WIDTH=100% ALIGN=center BORDER=0 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD ALIGN=right NOWRAP>網絡打印機路徑:</TD>
<TD ALIGN=left NOWRAP><INPUT type="text" id=printerpath name=printerpath 
value="< Domain >< Printer >"></TD>
</TR>
<TR>
<TD ALIGN=right NOWRAP>登錄帳號:</TD>
<TD ALIGN=left NOWRAP><INPUT type="text" id=username name=username 
value="<% = strUsername %>"></TD>
</TR>
<TR>
<TD ALIGN=right NOWRAP>登錄口令:</TD>
<TD ALIGN=left NOWRAP><INPUT type="password" id=password 
name=password></TD>
</TR>
<TR>
<TD ALIGN=right NOWRAP>請輸入你想打印的文字:</TD>
<TD ALIGN=left NOWRAP><TEXTAREA rows=2 cols=20 id=message 
name=message></TEXTAREA></TD>
</TR>
<TR>
<TD ALIGN=right NOWRAP> </TD>
<TD ALIGN=left NOWRAP><INPUT type="submit" value="Submit" 
id=submit name=submit></TD>
</TR>
</TABLE>
</FORM>

當以上信息被提交后,就可以按照下面的代碼進行打印了。
<%
Else
' 從form中取得響應信息。
strPrinterPath = Request.Form("printerpath")
strUsername = Request.Form("username")
strPassword = Request.Form("password")
strMessage = Request.Form("message")

We will now use the VBScript FileSystemObject object and the WSH Network object. The Network object will
give us the methods we need to open a printer connection, and the FileSystemObject will allow us to stream our
output to the printer. We create these objects in the following code example: 

快播電影網[www.aikan.tv/special/kuaibodianyingwang/]
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 合肥市| 漳平市| 鄂托克前旗| 昭平县| 阳江市| 犍为县| 汶上县| 武功县| 岑溪市| 双牌县| 丰宁| 永济市| 玉林市| 尉犁县| 巴彦淖尔市| 揭东县| 平谷区| 会宁县| 中宁县| 昌黎县| 岳普湖县| 涟水县| 宁津县| 玛纳斯县| 韶关市| 黎城县| 兖州市| 兴海县| 奉贤区| 都江堰市| 清水河县| 竹山县| 宿松县| 加查县| 南涧| 娄底市| 东光县| 株洲县| 冷水江市| 白水县| 弥勒县|