Imports System.Drawing.PrintingImports System.Runtime.InteropServices Public Class Page <Runtime.InteropServices.DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _ SetLastError:=True, CharSet:=CharSet.Unicode, _ Ex
通常web技术无法设置本地计算机的默认打印机,包括用代码设置纸张大小,如果业务系统中真遇到这种需求,只能通过其它辅助手段(比如ActiveX)实现.下面这段代码,出自网上被广泛使用的"泥人张打印API"(抱歉未找到原始出处),已经用C#封装了很多关于底层打印的API方法 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; usin