| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 434 人关注过本帖
标题:请教C#下如何实现下列VB代码
取消只看楼主 加入收藏
tangyunzhong
Rank: 5Rank: 5
来 自:广西
等 级:职业侠客
威 望:4
帖 子:97
专家分:364
注 册:2010-7-28
结帖率:100%
收藏
 问题点数:0 回复次数:0 
请教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);
结果不通
搜索更多相关主题的帖子: 记录 如何 
2011-06-28 18:15
快速回复:请教C#下如何实现下列VB代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024657 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved