终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

242 satır
9.7 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BPASmartClient.Argox
  8. {
  9. internal class DLLHelper
  10. {
  11. public const uint IMAGE_BITMAP = 0;
  12. public const uint LR_LOADFROMFILE = 16;
  13. [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  14. public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad);
  15. [DllImport("Gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  16. public static extern int DeleteObject(IntPtr ho);
  17. public const string szSavePath = "C:\\Argox";
  18. public const string szSaveFile = "C:\\Argox\\PPLB_Example.Prn";
  19. public const string sznop1 = "nop_front\r\n";
  20. public const string sznop2 = "nop_middle\r\n";
  21. [DllImport("Winpplb.dll")]
  22. public static extern int B_Bar2d_Maxi(int x, int y, int cl, int cc, int pc, string data);
  23. [DllImport("Winpplb.dll")]
  24. public static extern int B_Bar2d_PDF417(int x, int y, int w, int v, int s, int c, int px, int py, int r, int l, int t, int o, string data);
  25. [DllImport("Winpplb.dll")]
  26. public static extern int B_Bar2d_PDF417_N(int x, int y, int w, int h, string pParameter, string data);
  27. [DllImport("Winpplb.dll")]
  28. public static extern int B_Bar2d_DataMatrix(int x, int y, int r, int l, int h, int v, string data);
  29. [DllImport("Winpplb.dll")]
  30. public static extern void B_ClosePrn();
  31. [DllImport("Winpplb.dll")]
  32. public static extern int B_CreatePrn(int selection, string filename);
  33. [DllImport("Winpplb.dll")]
  34. public static extern int B_Del_Form(string formname);
  35. [DllImport("Winpplb.dll")]
  36. public static extern int B_Del_Pcx(string pcxname);
  37. [DllImport("Winpplb.dll")]
  38. public static extern int B_Draw_Box(int x, int y, int thickness, int hor_dots, int ver_dots);
  39. [DllImport("Winpplb.dll")]
  40. public static extern int B_Draw_Line(char mode, int x, int y, int hor_dots, int ver_dots);
  41. [DllImport("Winpplb.dll")]
  42. public static extern int B_Error_Reporting(char option);
  43. [DllImport("Winpplb.dll")]
  44. public static extern IntPtr B_Get_DLL_Version(int nShowMessage);
  45. [DllImport("Winpplb.dll")]
  46. public static extern int B_Get_DLL_VersionA(int nShowMessage);
  47. [DllImport("Winpplb.dll")]
  48. public static extern int B_Get_Graphic_ColorBMP(int x, int y, string filename);
  49. [DllImport("Winpplb.dll")]
  50. public static extern int B_Get_Graphic_ColorBMPEx(int x, int y, int nWidth, int nHeight, int rotate, string id_name, string filename);
  51. [DllImport("Winpplb.dll")]
  52. public static extern int B_Get_Graphic_ColorBMP_HBitmap(int x, int y, int nWidth, int nHeight, int rotate, string id_name, IntPtr hbm);
  53. [DllImport("Winpplb.dll")]
  54. public static extern int B_Get_Pcx(int x, int y, string filename);
  55. [DllImport("Winpplb.dll")]
  56. public static extern int B_Initial_Setting(int Type, string Source);
  57. [DllImport("Winpplb.dll")]
  58. public static extern int B_WriteData(int IsImmediate, byte[] pbuf, int length);
  59. [DllImport("Winpplb.dll")]
  60. public static extern int B_ReadData(byte[] pbuf, int length, int dwTimeoutms);
  61. [DllImport("Winpplb.dll")]
  62. public static extern int B_Load_Pcx(int x, int y, string pcxname);
  63. [DllImport("Winpplb.dll")]
  64. public static extern int B_Open_ChineseFont(string path);
  65. [DllImport("Winpplb.dll")]
  66. public static extern int B_Print_Form(int labset, int copies, string form_out, string var);
  67. [DllImport("Winpplb.dll")]
  68. public static extern int B_Print_MCopy(int labset, int copies);
  69. [DllImport("Winpplb.dll")]
  70. public static extern int B_Print_Out(int labset);
  71. [DllImport("Winpplb.dll")]
  72. public static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow, int width, int height, char human, string data);
  73. [DllImport("Winpplb.dll")]
  74. public static extern void B_Prn_Configuration();
  75. [DllImport("Winpplb.dll")]
  76. public static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor, int ver_factor, char mode, string data);
  77. [DllImport("Winpplb.dll")]
  78. public static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name, string data);
  79. [DllImport("Winpplb.dll")]
  80. public static extern int B_Prn_Text_TrueType(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, string data);
  81. [DllImport("Winpplb.dll")]
  82. public static extern int B_Prn_Text_TrueType_W(int x, int y, int FHeight, int FWidth, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, string data);
  83. [DllImport("Winpplb.dll")]
  84. public static extern int B_Select_Option(int option);
  85. [DllImport("Winpplb.dll")]
  86. public static extern int B_Select_Option2(int option, int p);
  87. [DllImport("Winpplb.dll")]
  88. public static extern int B_Select_Symbol(int num_bit, int symbol, int country);
  89. [DllImport("Winpplb.dll")]
  90. public static extern int B_Select_Symbol2(int num_bit, string csymbol, int country);
  91. [DllImport("Winpplb.dll")]
  92. public static extern int B_Set_Backfeed(char option);
  93. [DllImport("Winpplb.dll")]
  94. public static extern int B_Set_Backfeed_Offset(int offset);
  95. [DllImport("Winpplb.dll")]
  96. public static extern int B_Set_CutPeel_Offset(int offset);
  97. [DllImport("Winpplb.dll")]
  98. public static extern int B_Set_BMPSave(int nSave, string strBMPFName);
  99. [DllImport("Winpplb.dll")]
  100. public static extern int B_Set_Darkness(int darkness);
  101. [DllImport("Winpplb.dll")]
  102. public static extern int B_Set_DebugDialog(int nEnable);
  103. [DllImport("Winpplb.dll")]
  104. public static extern int B_Set_Direction(char direction);
  105. [DllImport("Winpplb.dll")]
  106. public static extern int B_Set_Form(string formfile);
  107. [DllImport("Winpplb.dll")]
  108. public static extern int B_Set_Labgap(int lablength, int gaplength);
  109. [DllImport("Winpplb.dll")]
  110. public static extern int B_Set_Labwidth(int labwidth);
  111. [DllImport("Winpplb.dll")]
  112. public static extern int B_Set_Originpoint(int hor, int ver);
  113. [DllImport("Winpplb.dll")]
  114. public static extern int B_Set_Prncomport(int baud, char parity, int data, int stop);
  115. [DllImport("Winpplb.dll")]
  116. public static extern int B_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity, int nStopBits, int nDsr, int nCts, int nXonXoff);
  117. [DllImport("Winpplb.dll")]
  118. public static extern int B_Set_Speed(int speed);
  119. [DllImport("Winpplb.dll")]
  120. public static extern int B_Set_ProcessDlg(int nShow);
  121. [DllImport("Winpplb.dll")]
  122. public static extern int B_Set_ErrorDlg(int nShow);
  123. [DllImport("Winpplb.dll")]
  124. public static extern int B_GetUSBBufferLen();
  125. [DllImport("Winpplb.dll")]
  126. public static extern int B_EnumUSB(byte[] buf);
  127. [DllImport("Winpplb.dll")]
  128. public static extern int B_CreateUSBPort(int nPort);
  129. [DllImport("Winpplb.dll")]
  130. public static extern int B_ResetPrinter();
  131. [DllImport("Winpplb.dll")]
  132. public static extern int B_GetPrinterResponse(byte[] buf, int nMax);
  133. [DllImport("Winpplb.dll")]
  134. public static extern int B_TFeedMode(int nMode);
  135. [DllImport("Winpplb.dll")]
  136. public static extern int B_TFeedTest();
  137. [DllImport("Winpplb.dll")]
  138. public static extern int B_CreatePort(int nPortType, int nPort, string filename);
  139. [DllImport("Winpplb.dll")]
  140. public static extern int B_Execute_Form(string form_out, string var);
  141. [DllImport("Winpplb.dll")]
  142. public static extern int B_Bar2d_QR(int x, int y, int model, int scl, char error, char dinput, int c, int d, int p, string data);
  143. [DllImport("Winpplb.dll")]
  144. public static extern int B_GetNetPrinterBufferLen();
  145. [DllImport("Winpplb.dll")]
  146. public static extern int B_EnumNetPrinter(byte[] buf);
  147. [DllImport("Winpplb.dll")]
  148. public static extern int B_CreateNetPort(int nPort);
  149. [DllImport("Winpplb.dll")]
  150. public static extern int B_Prn_Text_TrueType_Uni(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, byte[] data, int format);
  151. [DllImport("Winpplb.dll")]
  152. public static extern int B_Prn_Text_TrueType_UniB(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, byte[] data, int format);
  153. [DllImport("Winpplb.dll")]
  154. public static extern int B_GetUSBDeviceInfo(int nPort, byte[] pDeviceName, out int pDeviceNameLen, byte[] pDevicePath, out int pDevicePathLen);
  155. [DllImport("Winpplb.dll")]
  156. public static extern int B_Set_EncryptionKey(string encryptionKey);
  157. [DllImport("Winpplb.dll")]
  158. public static extern int B_Check_EncryptionKey(string decodeKey, string encryptionKey, int dwTimeoutms);
  159. [DllImport("Winpplb.dll")]
  160. public static extern int B_Set_CommTimeout(int ReadTotalTimeoutConstant, int WriteTotalTimeoutConstant);
  161. [DllImport("Winpplb.dll")]
  162. public static extern int B_Get_CommTimeout(out int ReadTotalTimeoutConstant, out int WriteTotalTimeoutConstant);
  163. [DllImport("Winpplb.dll")]
  164. public static extern int B_Set_LabelForSmartPrint(int lablength, int gaplength);
  165. }
  166. }