C# 设置打印机共享 能否实现 ?,不是设置默认打印机

解决方案 »

  1.   

    本地实现:可以,把printDocument.PrinterSettings.PrinterName ="打印机名称"就行了
    共享的需要:路径便可 比如\\192.168.1.100\HP LaserJet M1522 MFP Series PCL 6
      

  2.   

    本地实现:可以,把printDocument.PrinterSettings.PrinterName ="打印机名称"就行了
    共享的需要:路径便可 比如\\192.168.1.100\HP LaserJet M1522 MFP Series PCL 6
    看看是否对你有帮助
      

  3.   


    printDocument.PrinterSettings.PrinterName ="打印机名称"
    这个是设置要使用的打印机,并不是设置共享
    我想实现的是通过代码实现共享人,然后通过\\127.0.0.1\TSC TE344这样来调用打印机就找不到设置共享的方法,用代码
      

  4.   

    可以,你看下 PrintDocument 对象下有没有,如果没有就调用 系统 api 即可。 
      

  5.   


    不用PrintDocument ,我用的是ZPL指令,然后发送到共享打印机
    PrintDocument 也没有设置共享的就是不知具体的系统api,设置共享打印机
      

  6.   

    https://blog.csdn.net/zlyperson/article/details/12484
      

  7.   

    https://www.pcreview.co.uk/threads/share-a-printer-from-the-command-line.1735170/参考下,用CMD共享打印机
      

  8.   

    https://www.codeproject.com/Articles/80680/Managing-Printers-Programatically-using-C-and-WMI
      

  9.   

    cmd 命令  //设置打印机共享名称  123是打印名
    rundll32 printui.dll,PrintUIEntry /Xs /n "123" Sharename "123"
    //设置打印机共享  123是打印名
    rundll32 printui.dll,PrintUIEntry /q /Xs /n "123" Attributes Shared