从vb6到vb.net的转换 [英] Conversion from vb6 to vb.net

查看:136
本文介绍了从vb6到vb.net的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些pcl文档,其信息嵌入在前几行中.在将pcl文档转换为要成像的tiff文档之前,需要将其删除.

在vb6中,我使用了:

I have some pcl documents with information embeded in the first couple of lines. These need to be removed bfore converting the pcl document to a tiff document to be imaged.

In vb6 I used:

Put #outFile, , Replace(StrConv(InputB(LOF(fileNum), fileNum), vbUnicode), sString, "", 1, 1, vbBinaryCompare)



我正在打开文件二进制文件,将其转换为字符串并替换该字符串,基本上是删除该字符串并将其保存到新文件中.我曾尝试在vb.net中对此进行编码,但未能使其正常工作.



I am opening the file binary converting to a string and replacing the string, basically deltting the string and saving it to a new file. I have tried to code this in vb.net, but have not been able to make it work.

推荐答案

我找到了一种方法来完成所需的工作.

I found a way to accomplish what I needed.

FileOpen(5, "C:\Temp\TempImg.pcl", OpenMode.Output)
Do Until EOF(fileNum)
    sString1 = LineInput(fileNum)
    position = InStr(sString1, "INDEXX:")
    If position > 0 Then
        sString = sString1
        sString1 = ""
    End If
    Print(5, sString1 & vbCrLf)
Loop
FileClose(5)
FileClose(fileNum)

imageFile = My.Computer.FileSystem.ReadAllBytes"C:\Temp\TempImg.pcl")
My.Computer.FileSystem.WriteAllBytes(TempDir + sFileName, imageFile, False)


这篇关于从vb6到vb.net的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆