资源简介
本实例是用C#开发的和斑马打印机通信的实例程序,支持串口、USB口和并口。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Collections;
using System.Runtime.InteropServices;
using System.IO;
using System.xml;
using System.xml.Serialization;
namespace Colibri.CommonModule
{
///
/// Common Class that contains static common functions
///
///
public class Parameter
{
public static string ScanBarcode1 = “Barcode1“; //条码枪1
public static string ScanBarcode2 = “Barcode2“; //条码枪2
public static string ScanBarcode3 = “Barcode3“; //条码枪3
public static string ScanBarcode4 = “Barcode4“; //条码枪4
public static int DutCountName = 0;
public static string Scan1 = “ScanSleep“;
public static string Scan2 = “ScanSleep“;
public static int phonelen = 0;
public static int chargelen = 0;
public static int boxlen = 0;
public static string Print1 = “00“;
public static string Print2 = “00“;
}
public class CommonClass
{
#region valid
///
/// Check the type of obj is not null and is the type that sepecified by the second parameter
///
/// Checking object instance
/// Expected type
/// Checking result true means valid
public static bool IsValidType(object obj Type type)
{
return obj != null && obj.GetType() == type;
}
#endregion
#region Get Random result for test
///
/// Get random result
///
/// specify fail rate 0~1
/// random result pass or fail based on fail rate
public static bool GetRandomResult(double failRate = 0.5)
{
Random random = new Random();
double value = random.NextDouble();
return value > failRate;
}
#endregion
#region Time string
///
/// Get time string for current time with default format(“yyyy-MM-dd HH:mm:ss.fff“)
///
/// string of current time
public static string GetNowTimeString()
{
return GetTimeString(System.DateTime.Now);
}
///
/// Get time string for current time with specified format
///
/// the string format
/// string of current time
public static string GetNowTimeString(string format)
{
return GetTimeString(System.DateTime.Nowformat);
}
///
/// Get time string for the spe
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 328192 2017-01-06 14:08 BarcodePrinter170705\.vs\BarcodePrinter\v14\.suo
..A..H. 301056 2016-10-27 13:29 BarcodePrinter170705\BarcodePrinter\.vs\BarcodePrinter\v14\.suo
文件 974 2016-11-18 14:48 BarcodePrinter170705\BarcodePrinter\App.config
文件 8715 2017-06-25 21:05 BarcodePrinter170705\BarcodePrinter\BarcodePrinter.csproj
文件 932 2016-10-20 15:23 BarcodePrinter170705\BarcodePrinter\BarcodePrinter.sln
..A..H. 295936 2016-10-23 17:42 BarcodePrinter170705\BarcodePrinter\BarcodePrinter.v11.suo
文件 31996 2016-11-25 13:27 BarcodePrinter170705\BarcodePrinter\bin\1.txt
文件 4911 2016-11-25 13:28 BarcodePrinter170705\BarcodePrinter\bin\2.txt
文件 546 2016-11-25 13:28 BarcodePrinter170705\BarcodePrinter\bin\3.txt
文件 196608 2017-08-31 13:47 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.exe
文件 974 2016-11-18 14:48 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.exe.config
文件 323072 2017-08-31 13:47 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.pdb
文件 22984 2017-09-23 16:10 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.vshost.exe
文件 974 2016-11-18 14:48 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.vshost.exe.config
文件 3301 2016-10-28 09:08 BarcodePrinter170705\BarcodePrinter\bin\Debug\BarcodePrinter.vshost.exe.manifest
文件 2208 2016-11-17 22:15 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-11-17-Error.log
文件 8336 2016-11-17 22:15 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-11-17-Print.log
文件 2163 2016-12-15 10:28 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-12-15-Error.log
文件 4582 2016-12-15 10:28 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-12-15-Print.log
文件 276 2016-12-21 10:35 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-12-21-Error.log
文件 25042 2016-12-21 10:37 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2016-12-21-Print.log
文件 3576 2017-06-22 17:00 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-22-Error.log
文件 5824 2017-06-22 17:22 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-22-Print.log
文件 2931 2017-06-24 19:58 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-24-Error.log
文件 146390 2017-06-24 19:59 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-24-Print.log
文件 2325 2017-06-25 15:49 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-25-Error.log
文件 14379 2017-06-25 15:49 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-25-Print.log
文件 1754 2017-06-27 17:42 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-27-Error.log
文件 23203 2017-06-27 17:56 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-27-Print.log
文件 3916 2017-06-28 16:00 BarcodePrinter170705\BarcodePrinter\bin\Debug\logs\2017-06-28-Error.log
............此处省略139个文件信息
- 上一篇:C#医院管理系统课程设计用
- 下一篇:上位机C#以太网连接三菱PLC
相关资源
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论