Ejemplo n.º 1
0
 public bool Write(byte[] mybyte)
 {
     if (this.iHandle != -1)
     {
         LptControl.OVERLAPPED oVERLAPPED = default(LptControl.OVERLAPPED);
         int num = 0;
         return(LptControl.WriteFile(this.iHandle, mybyte, mybyte.Length, ref num, ref oVERLAPPED));
     }
     throw new Exception("[Pos 3002] 不能连接到打印机!");
 }
Ejemplo n.º 2
0
 public bool Write(string Mystring)
 {
     if (this.iHandle != -1)
     {
         LptControl.OVERLAPPED oVERLAPPED = default(LptControl.OVERLAPPED);
         int    num   = 0;
         byte[] bytes = Encoding.GetEncoding("GB2312").GetBytes(Mystring);
         return(LptControl.WriteFile(this.iHandle, bytes, bytes.Length, ref num, ref oVERLAPPED));
     }
     throw new Exception("[Pos 3001] 不能连接到打印机!");
 }