How to implement network printing function in ASP

zhaozj2021-02-16  55

Used technology: ASP, WSH, VBScript file aspprint.asp code as follows:

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

DIM STRSUBMIT 'FORM Save Submit button DIM STRPRINTERPATH' FORM Save Network Printer Path Value DIM STRUSERNAME 'FORM User Name DIM STRPASSWORD' FORM DIM STRMESSAGE 'FORM Print content DIM OBJFS 'VBScript file system object DIM ObjWshNet' WSH Network Object DIM Objprinter 'Print Object

STRSUBMIT = Request.form ("Submit")%>

<% IF strsubmit = "" "" "

Note: Since I is a demonstration, it should be safely processed in the real application that NT's account and password is used in ASP.

network printer Path: < Tr> Login Account:
Please enter the text you want to print: