Guest User

Untitled

a guest
Jul 15th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Process p = new Process( );
  2. p.StartInfo = new ProcessStartInfo( )
  3. {
  4. CreateNoWindow = true,
  5. Verb = "print",
  6. FileName = path //put the correct path here
  7. };
  8. p.Start( );
  9.  
  10. public static bool Print(string file, string printer) {
  11. try {
  12. Process.Start(
  13. Registry.LocalMachine.OpenSubKey(
  14. @"SOFTWAREMicrosoftWindowsCurrentVersion" +
  15. @"App PathsAcroRd32.exe").GetValue("").ToString(),
  16. string.Format("/h /t "{0}" "{1}"", file, printer));
  17. return true;
  18. } catch { }
  19. return false;
  20. }
  21.  
  22. Process.Start("LPR -S printerdnsalias -P raw C:filesfile.pdf");
Add Comment
Please, Sign In to add comment