Beispiel #1
0
        private void ClickEvent(object sender, EventArgs e)
        {
            byte[] testchar = new byte[100];
            byte[] tmpfeed  = { 0xd, 0xa }; //Comando feedline

            Aclasdriver.Printer obj_printer = new Aclasdriver.Printer();
            testchar = Encoding.ASCII.GetBytes(text.Text);
            obj_printer.Open();
            obj_printer.Write(testchar);
            obj_printer.Write(tmpfeed);
            obj_printer.Feed(1000);
        }
        private void Button_Click(object sender, EventArgs e)
        {
            byte[] testchar = { 0x1b, 0x21, 0x00, (byte)'P', (byte)'R', (byte)'U', (byte)'E', (byte)'B', (byte)'A' };
            byte[] tmpfeed  = { 0xd, 0xa };
            Aclasdriver.Printer obj_printer = new Aclasdriver.Printer();
            //Aclasdriver.
            obj_printer.Open();
            //Lib.Open();

            //Lib.Write(tmpfeed);
            obj_printer.Write(tmpfeed);

            for (int j = 0; j < 10; j++)
            {
                //Lib.Write(tmpfeed);
                obj_printer.Write(tmpfeed);
            }

            for (int j = 0; j < 2; j++)
            {
                // Lib.Write(testchar);
                obj_printer.Write(testchar);


                for (int i = 0; i < 30; i++)
                {
                    byte[] tmpbuf = { 0x0d, 0x0a };
                    //Lib.Write(tmpbuf);
                    obj_printer.Write(tmpbuf);
                }
            }

            for (int i = 0; i < 2; i++)
            {
                // Lib.Feed(5000);
                obj_printer.Feed(1000);
            }
        }