vb转成vb.net vb 转c#

vb 改vb.net使用.net的升级向导,虽然不能完全升级但大部分代码都升级了,再做略微修改
vb的回调函数转为vb.NET先声明一个委托vb转成vb.net:
Public Delegate Function EnumChildProc(hwnd As Integer, iParam As Integer) As Integer
然后才能使用回调函数vb转成vb.net , 回调函数vb转成vb.net的参数要和委托完全一致 。
然后那个 API 函数需要这样声明vb转成vb.net:
Declare Function EnumChildWindows Lib "user32" (hWndParent As Integer, lpEnumFunc As EnumChildProc, lParam As Integer) As Integer
下面的VB6.0编写的代码怎么转为VB.netDim file1 As FileStream
filename = "c:\temp\MyTest.txt"
Dim GetData(4) As Byte, s(4) As Char
file1 = System.IO.File.OpenRead(filename)
Dim CMGs As Long
Dim DPBo As Long
Dim i As Integer = 0, j As Integer
While file1.Read(GetData, 0, 5)0
i = i + 1
For j = 0 To 4
s(j) = ChrW(GetData(j))
Next
If s = "CMG=""" Then CMGs = i
If s = "[Host" Then DPBo = i - 2 : Exit While
End While
主要是vb.net取消vb转成vb.net了定长字符串, 所以用字节数组读入, 还得转成字符数组来比较.
【vb转成vb.net vb 转c#】关于vb转成vb.net和vb 转c#的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。

    推荐阅读