-
大小: 708KB文件類型: .rar金幣: 1下載: 1 次發(fā)布日期: 2021-06-04
- 語言: C#
- 標(biāo)簽: 條碼打印??標(biāo)簽打印??C#??B/S??
資源簡介
內(nèi)含標(biāo)簽打印機(jī)的實(shí)例 包括B/S 和C/S的
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Runtime.InteropServices;
namespace?FormActive
{
????public?class?CallOutPrint
????{
????????[DllImport(“zebracom.dll“?EntryPoint?=?“VS_PortOpen“?SetLastError?=?true?CharSet?=?CharSet.Ansi?CallingConvention?=?CallingConvention.StdCall)]
????????private?static?extern?int?VS_PortOpen(int?Port?int?BaudSpeed);
????????///?
????????///?打開通訊端口函數(shù)
????????///?
????????///?打開通訊端口(1-并口一;2-并口二;3-串口一;4-串口二?5-usb)
????????///?串口速率(96001920038400)?
????????///?0?正常返回 -1?打開端口出錯(cuò)
????????public?static?int?PortOpen(int?Port?int?BaudSpeed)
????????{
????????????int?r?=?-1;
????????????try
????????????{
????????????????r?=?VS_PortOpen(Port?BaudSpeed);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?new?Exception(“PortOpen出錯(cuò)Port:“?+?Port?+?“BaudSpeed:“?+?BaudSpeed?+?“錯(cuò)誤:“?+?ex.Message);
????????????????//RecordLog.writeFile(LogTypeEnum.Error?“PortOpen出錯(cuò)Port:“?+?Port?+?“BaudSpeed:“?+?BaudSpeed?+?“錯(cuò)誤:“?+?ex.Message);
????????????}
????????????return?r;
????????}
????????[DllImport(“zebracom.dll“?EntryPoint?=?“VS_SetPrintXY“?SetLastError?=?true?CharSet?=?CharSet.Ansi?CallingConvention?=?CallingConvention.StdCall)]
????????private?static?extern?int?VS_SetPrintXY(int?iX?int?iY);
????????///?
????????///?設(shè)置打印機(jī)的坐標(biāo)圓點(diǎn)函數(shù)
????????///?
????????///?打印區(qū)域水平起始位置
????????///?打印區(qū)域垂直起始位置
????????///?
????????public?static?int?SetPrintXY(int?x?int?y)
????????{
????????????int?r?=?-1;
????????????try
????????????{
????????????????r?=?VS_SetPrintXY(x?y);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?new?Exception(“SetPrintXY錯(cuò)誤:“?+?ex.Message);
????????????????//RecordLog.writeFile(LogTypeEnum.Error?“SetPrintXY錯(cuò)誤:“?+?ex.Message);
????????????}
????????????return?r;
????????}
????????[DllImport(“zebracom.dll“?EntryPoint?=?“VS_SetPrintBack“?SetLastError?=?true?CharSet?=?CharSet.Ansi?CallingConvention?=?CallingConvention.StdCall)]
????????private?static?extern?int?VS_SetPrintBack(int?iBack);
????????///?
????????///?設(shè)置打印機(jī)每次打印是否都要回退函數(shù)
????????///?
????????///?回退標(biāo)志(0-回退(默認(rèn)),1-不回退)
????????///?0?成功 -1?失敗
????????public?static?int?SetPrintBack(int?iBack)
????????{
????????????int?r?=?-1;
????????????try
????????????{
????????????????r?=?VS_SetPrintBack(iBack);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?new?Exception(“SetPrintBack錯(cuò)誤:“?+?ex.Message);
????????????????//RecordLog.writeFile(LogTypeEnum.Error?“SetPrintBack錯(cuò)誤:“?+?ex.Message);
????????????}
????????????return?r;
????????}
????????[DllImport(“zebracom.dll“?EntryPoint?=?“VS_SetDark
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????2495??2009-12-18?17:57??Web調(diào)用activex打印條碼示例\CallDelphiPrintBar.aspx
?????文件???????2837??2009-12-17?16:25??Web調(diào)用activex打印條碼示例\CallDelphiPrintBar.aspx.cs
?????文件?????460800??2009-12-18?17:41??Web調(diào)用activex打印條碼示例\setup.exe
?????文件?????342528??2009-12-18?17:41??Web調(diào)用activex打印條碼示例\Setupbar.msi
?????文件????????213??2013-10-22?16:00??說明.txt
?????文件??????14336??2009-12-18?17:53??FormActive\FormActive\bin\Debug\FormActive.dll
?????文件??????34304??2009-12-18?17:53??FormActive\FormActive\bin\Debug\FormActive.pdb
?????文件???????3684??2009-12-18?17:53??FormActive\FormActive\bin\Debug\FormActive.tlb
?????文件???????1082??2009-12-17?18:43??FormActive\FormActive\bin\Debug\LogFile\2009-12-17日志文件.log
?????文件????????444??2009-12-18?17:35??FormActive\FormActive\bin\Debug\LogFile\2009-12-18日志文件.log
?????文件??????36864??2006-10-30?15:49??FormActive\FormActive\bin\Debug\zebracom.dll
?????文件??????14431??2009-12-18?14:50??FormActive\FormActive\CallOutPrint.cs
?????文件???????3136??2009-12-17?18:40??FormActive\FormActive\FormActive.csproj
?????文件????????168??2009-12-17?18:40??FormActive\FormActive\FormActive.csproj.user
?????文件????????805??2009-12-18?17:53??FormActive\FormActive\obj\Debug\FormActive.csproj.FileListAbsolute.txt
?????文件????????781??2009-12-18?17:53??FormActive\FormActive\obj\Debug\FormActive.csproj.GenerateResource.Cache
?????文件??????14336??2009-12-18?17:53??FormActive\FormActive\obj\Debug\FormActive.dll
?????文件??????34304??2009-12-18?17:53??FormActive\FormActive\obj\Debug\FormActive.pdb
?????文件????????180??2009-12-18?17:53??FormActive\FormActive\obj\Debug\FormActive.UserControl1.resources
?????文件????????589??2009-12-18?17:53??FormActive\FormActive\obj\FormActive.csproj.UnmanagedRegistration.cache
?????文件???????1444??2009-12-17?18:11??FormActive\FormActive\Properties\AssemblyInfo.cs
?????文件???????3565??2009-12-17?18:40??FormActive\FormActive\RecordLog.cs
?????文件??????14297??2009-12-18?17:53??FormActive\FormActive\UserControl1.cs
?????文件???????3104??2009-12-18?10:06??FormActive\FormActive\UserControl1.Designer.cs
?????文件???????5814??2009-12-18?10:06??FormActive\FormActive\UserControl1.resx
?????文件????????920??2009-12-17?17:03??FormActive\FormActive.sln
????..A..H.?????22016??2009-12-18?17:54??FormActive\FormActive.suo
?????文件??????33280??2009-12-18?16:38??FormPrintBarCode\FormPrintBarCode\bin\Debug\FormPrintBarCode.exe
?????文件??????42496??2009-12-18?16:38??FormPrintBarCode\FormPrintBarCode\bin\Debug\FormPrintBarCode.pdb
?????文件??????14328??2009-12-18?17:14??FormPrintBarCode\FormPrintBarCode\bin\Debug\FormPrintBarCode.vshost.exe
............此處省略58個(gè)文件信息
評(píng)論
共有 條評(píng)論