简体   繁体   中英

c# Print from the printer using usb Cable, without using ip address or shared printer

I'm looking for how to print from the printer without using an IP address or sharing the printer.

i am using the code below and i used the ip address \127.0.0.1\Citizen_CL-S700 for the printer but now i need to print without share the printer or use usb cable

StreamWriter writer = new StreamWriter(PrintFolder + @"\MEFU_" + Cmb_Serial_Print.Text + ".prn", true);
                        writer.Write(content);
                        writer.Close();

                        File.Copy(PrintFolder + @"\MEFU_" + Cmb_Serial_Print.Text + ".prn",\\127.0.0.1\Citizen_CL-S700);

Usage:

 using RawPrint;

    // Create an instance of the Printer
    IPrinter printer = new Printer();

    // Print the file
    printer.PrintRawFile(PrinterName, Filepath, Filename);

Installation:

To install Raw Print, run the following command in the Package Manager Console

PM> Install-Package RawPrint

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM