大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Are you Japanese? Why the slogan is Japanese?
红花岗网站建设公司创新互联,红花岗网站设计制作,有大型网站制作公司丰富经验。已为红花岗成百上千家提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的红花岗做网站的公司定做!
Your code directly put it in VB6.0 by use, save the source, then the open method of vb.net upgrade.
I'm not Japanese, so we had to communicate in English with you, sorry.
你可以直接打开 VB6 的程序,VB.net 会自动启动升级向导将你的 VB6 代码升级为 VB.net。
样是不行的,要转化成VB.net只有重新改编,因为框架不同语法也有太多的不同
Dim 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取消了定长字符串, 所以用字节数组读入, 还得转成字符数组来比较.
使用.net的升级向导,虽然不能完全升级但大部分代码都升级了,再做略微修改