如何通过代码清除打印机队列? [英] how to clear a printer queue through code?

查看:128
本文介绍了如何通过代码清除打印机队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我如何通过vb应用程序清除本地打印机队列,我遇到的问题是打印按钮被按下太多次并且作业排队并且打印机不打印,寻找方法要在每次点击按钮时清除打印机队列,请帮忙解决这个问题。



问候

Wesley



以下代码是打印机打印的按钮点击事件

 私人  Sub  PictureBox48_Click( ByVal  sender  As 系统。对象 ByVal  e 作为 System.EventArgs)句柄 PictureBox48。点击
' 用户已完成其详细信息的排序 - 现在打印D. T CARD

如果(((TextBox4.Text .Trim( )= ))(TextBox5 .Text.Trim( )= )))然后

Dim dt_card 作为 dt_card_printer

dt_card。 names = TextBox4.Text& & TextBox5.Text

dt_card.Print()

dt_card.Dispose()

结束 如果
结束 Sub

解决方案

以下几个链接



清除本地打印机队列中的作业 [ ^ ]





http://www.xtremevbtalk.com/showthread.php?t = 197690 [ ^ ]







接受并投票,如果有帮助,否则还原

--RDB

hi all how can i clear the local printers queue through a vb app, i''ve been experiencing a problem that the print button gets pushed too many times and the jobs queue up and the printer wont print, looking for a way to clear the printer queue each time the button is clicked, please help with this kinda urgent

regards
Wesley

code below is the button click event for the printer to print

Private Sub PictureBox48_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox48.Click
        ' USER HAS FINISHED TYPING IN THEIR DETAILS - NOW PRINT DT CARD

        If ((Not (TextBox4.Text.Trim(" ") = "")) And (Not (TextBox5.Text.Trim(" ") = ""))) Then

            Dim dt_card As New dt_card_printer

            dt_card.names = TextBox4.Text & " " & TextBox5.Text

            dt_card.Print()

            dt_card.Dispose()

        End If
    End Sub

解决方案

Below are few links

Clear jobs in local printer queue[^]


http://www.xtremevbtalk.com/showthread.php?t=197690[^]



Accept and vote if helps otherwise revert back
--RDB


这篇关于如何通过代码清除打印机队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆