哪哥们能帮我把以下C#.net代码转为VB.net代码

billow_chentao billow_chentao 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
using System;
using System.Runtime.InteropServices;
//using System.Windows.Forms;


namespace Beiyang
{
/// <summary>
/// Bpladll 的摘要说明。
/// </summary>
public class PrinterDll
{
public const int BPLA_OK = 1000; //一切正常
public const int BPLA_COMERROR = 1001; //通讯错或者未联接打印机
public const int BPLA_PARAERROR = 1002; //参数错误
public const int BPLA_FILEOPENERROR = 1003; //文件打开错误
public const int BPLA_FILEREADERROR = 1004; //文件读错误
public const int BPLA_FILEWRITEERROR = 1005; //文件写错误
public const int BPLA_FILEERROR = 1006; //文件不合要求
public const int BPLA_NUMBEROVER = 1007; //指定的接收信息数量过大
public const int BPLA_IMAGETYPEERROR = 1008; //图象文件格式不正确
//static string m_dllpath = Application.StartupPath+@"\BPLADLL.dll";

[DllImport("BPLADLL.dll")]
public static extern int BPLA_OpenCom(string comname, int intbaudrate, int handshake);

//打开串口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_OpenComEx(string comname, int intbaudrate, int handshake,int WriteTimeOut);

//关闭串口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_CloseCom();

//打开并口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_OpenLpt(int address, int busySleep);

// Setdirectory

//关闭并口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_CloseLpt();


//打开USB口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_OpenUsb();

//关闭USB口
[DllImport("BPLADLL.dll")]
public static extern int BPLA_CloseUsb();


//打开驱动
[DllImport("BPLADLL.dll")]
public static extern int BPLA_OpenPrinterDriver(string DriverName);

//关闭驱动
[DllImport("BPLADLL.dll")]
public static extern int BPLA_ClosePrinterDriver();

//开启打印作业
[DllImport("BPLADLL.dll")]
public static extern int BPLA_StartDoc();

//关闭打印作业
[DllImport("BPLADLL.dll")]
public static extern int BPLA_EndDoc();

//设置端口超时
[DllImport("BPLADLL.dll")]
public static extern int BPLA_SetTimeOut(int WriteTimeOut);

//保存文件
[DllImport("BPLADLL.dll")]
public static extern int BPLA_SetSaveFile(bool bsave,string filename,bool bport);

//进入标签
[DllImport("BPLADLL.dll")]
public static extern int BPLA_SetPaperLength(int PaperLength,int Length);

//进入标签
[DllImport("BPLADLL.dll")]
public static extern int BPLA_StartArea(int unitmode,int printwidth,int column,int row,int darkness,int speedprint,int speedfor,int speedbac);

//整体翻转
[DllImport("BPLADLL.dll")]
public static extern int BPLA_SetAllRotate(int rotatemode);
//打印标签
[DllImport("BPLADLL.dll")]
public static extern int BPLA_Print(int pieces,int samepieces,int outunit);
//直线
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintLine(int startx,int starty,int endx,int endy,int linewidth);
//内部字体0-8、000-007和P06-P18
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintText(string text,int startx,int starty,int rotate,int fonttype,int pointwidth,int pointheight,string addvalue,int space,int bitmode);
//已经下载的外部字体打印
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintOut(string text,int startx,int starty,int rotate,string fonttype,int pointwidth,int pointheight,string addvalue,int space,int bitmode);
//中英文混和打印
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintMixText(string text,int startx,int en_starty,int cn_starty,int rotate,int en_fonttype,string cn_fonttype,int en_width,int cn_width,int pointwidth,int pointheight,string addvalue,int space,int bitmode);
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintMixTextEx(string text,int startx,int en_starty,int xy_adjust,int rotate,string en_fonttype,string cn_fonttype,int pointwidth,int pointheight,string addvalue,int space,int bitmode);
//打印TRUETYPE字体
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintTruetype(string text,int startx,int starty,string fontname,int fontheight,int fontwidth);
//打印图像
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintImage(string filename,int startx,int starty,int bitmode);
//一维条码
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintBarcode(string codedata,int startx,int starty,int rotate,int bartype,int height,int number,int numberbase,string addvalue);
//PDF码
[DllImport("BPLADLL.dll")]
public static extern int BPLA_PrintPDF(string codedata,int startx,int starty,int rotate,int basewidth,int baseheight,int scalewidth,int scaleheight,int row,int column,int cutmode,int level,int length,string addvalue);
//测试状态
[DllImport("BPLADLL.dll")]
public static extern int BPLA_CheckStatus(byte[] papershort,byte[] ribbionshort,byte[] busy,byte[] pause,byte[] com,byte[] headheat,byte[] headover,byte[] cut);

}
}
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
billow_chentao
VB 16,718 成员 110,520 内容