VB.Net
Dim MyFileName As String = "C:/Help.doc" Dim MyStartInfo As New ProcessStartInfo(MyFileName) Dim CanPrint As Boolean = False For Each Verb As String In MyStartInfo.Verbs If (Verb.ToLower() = "print") Then CanPrint = True MyStartInfo.Verb = Verb End If Next If (CanPrint) Then Process.Start(MyStartInfo) Else MessageBox.Show("不能打印指定的文档!","信息提示",_ MessageBoxButtons.OK,MessageBoxIcon.Information) End If
原文链接:https://www.f2er.com/vb/261339.html