请教C#下如何实现下列VB代码
下面是VB代码片段:... Dim log() As PosLogInfo ... Case 2 '读所有记录 GetDeviceVersion = "" strFuncData = objComm.SysGetDeviceVersion strCmd = objComm.CreateBstrCommand(MacID, MacType, strFuncData) '生成指令帧 If Not ExecCommandIsSuccess(cmdXF(Index).Caption) Then Exit Sub GetDeviceVersion = objComm.GetMacModelVersion(strFrame) strFuncData = objComm.XFAllLogCount strCmd = objComm.CreateBstrCommand(MacID, MacType, strFuncData) '生成指令帧 txtSend.Text = txtSend.Text & strCmd & vbCrLf If Not ExecCommandIsSuccess(cmdXF(Index).Caption) Then Exit Sub objComm.GetRecordCount strFrame, GetDeviceVersion, RecordSector, RecordCount For i = 1 To RecordSector DoEvents strFuncData = objComm.XFAllLogData & objComm.NumToHexStr(i, 2) strCmd = objComm.CreateBstrCommand(MacID, MacType, strFuncData) '生成指令帧 txtSend.Text = txtSend.Text & strCmd & vbCrLf If Not ExecCommandIsSuccess(cmdXF(Index).Caption, False) Then Exit For If MacType = 6 Then If objComm.GetXFLogOrder(strFrame, log) Then For j = 0 To UBound(log) txtReturn.Text = txtReturn.Text & log(j).SFType & " " & log(j).SFMealTypeID & " " & _ log(j).CardNo & " " & log(j).SFDate & " " & log(j).SFAmount & " " & _ log(j).CardBalance & " " & log(j).CardUseTimes & vbCrLf Next Else txtReturn.Text = txtReturn.Text & strFrame & vbCrLf End If Else If objComm.GetXFLog(strFrame, log()) Then For j = 0 To UBound(log) txtReturn.Text = txtReturn.Text & log(j).SFType & " " & log(j).SFMealTypeID & " " & _ log(j).CardNo & " " & log(j).SFDate & " " & log(j).SFAmount & " " & _ log(j).CardBalance & " " & log(j).CardUseTimes & vbCrLf Next Else txtReturn.Text = txtReturn.Text & strFrame & vbCrLf End If End If Next
上面这个代码是VB的 都是调用DLL 我现在在C#的写法遇到两个问题
1.PosLogInfo这个是结构体,C#的定义?
2.objComm.GetXFLog(strFrame, log())这个语句里面参数log()在C#中应该什么写?
下面是我乱写了一下:
...
ECardDeviceAPI.PosLogInfo[] log= new ECardDeviceAPI.PosLogInfo[20];
...
objComm.GetXFLog("1111111111",ref log);
结果不通