本文介绍了使用Processstartinfo.verb =“print”命令打印多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Processstartinfo.verb =print命令打印文件夹中的所有图像



i有代码打印单个图像,如下所示/>

i want to print all the images in a folder by using Processstartinfo.verb="print" command

i have the code to print single image like this

dim psinfo as new processstartinfo
psinfo.verb="print"
psinfo.createnowindow=false
psinfo.filename="d:/imgfolder/0001.jpg"
process.start(psinfo)





但我希望一次打印更多图片这个命令。在文件夹中,如果我选择所有图像(Ctrl + A),然后右键单击,然后打印。然后这工作正常并打印所有图像。以同样的方式我想用vb.net打印图像如果有人知道怎么做,请回复....



but i want to print more images at a time by using this command. in Folder if i select all images(Ctrl+A) and then RightClick and then print. then this is working fine and printing all images. in the same way i want to print images using vb.net if Anyone know how to do this please reply....

推荐答案

For Each file In IO.Directory.GetFiles(folderPath)
    Try
        Dim psi As New ProcessStartInfo(file )

        If psi.Verbs.Contains("print") Then
            psi.Verb = "print"
            psi.UseShellExecute = True
            psi.WindowStyle = ProcessWindowStyle.Hidden
            psi.CreateNoWindow = True
            Process.Start(psi).WaitForExit()
        Else
            MessageBox.Show("No 'print' verb associated with file extension " & IO.Path.GetExtension(file))
        End If
    Catch ex As Exception
        MessageBox.Show(ex.ToString())
    End Try
Next





[]


这篇关于使用Processstartinfo.verb =“print”命令打印多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 02:27
查看更多