首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

急C#源碼轉VB源碼問題,该如何处理

2012-06-08 
急:C#源碼轉VB源碼問題下面段C#的 winfrom源碼怎麼轉換成VB語言代碼,求幫助!!!private void readcard(){by

急:C#源碼轉VB源碼問題
下面段C#的 winfrom源碼怎麼轉換成VB語言代碼,求幫助!!!
private void readcard()
  {
  byte[] byteuid = new byte[256];
  byte[] byteBuffer = new byte[256];
  string strErrorCode = "";
  string strFlag = "";
  int nFlag = 0;//卡类型不一样,0x42返回值带安全状态字节,0x02返回值不带安全状态字节
  strFlag = "02";
  int nRet =MiReader.ISO15693_Read(Convert.ToByte(strFlag), Convert.ToByte(textReadArea.Text), Convert.ToByte(textReadNum.Text), byteuid, byteBuffer);
}

MiReader類方法:
[DllImport("mi.dll")]
public static extern int ISO15693_Read(byte flag, byte blk_add, byte num_blk, [In]byte[] uid, [In]byte[] buffer);

重要的是紅色部份的轉換。。。多謝!!!

[解决办法]
Public Declare Function ISO15693_Read Lib "mi.dll" (ByVal flag As Byte, ByVal blk_add As Byte, ByVal num_blk As Byte, ByRef uid As Byte, ByRef buffer As Byte) As Long


[解决办法]

VB code
Private Function FormatErrorCode(ByRef bytes() As Byte) As StringSelect Case bytes(0)Case &H80    FormatErrorCode = "Success"Case &H81     FormatErrorCode = "Parameter Error"Case &H82     FormatErrorCode = "Communication TimeOut"Case &H83     FormatErrorCode = "Can't Find Card"Case Else     FormatErrorCode = "Command Error"End SelectEnd Function 

热点排行