View Single Post
Old 06-10-2009, 09:05 AM   #1 (permalink)
darksteel88
Registered User
 
Join Date: Jul 2008
Location: Canada
Posts: 114
OS: XP Pro SP2;Vista Home Premium SP1


Send a message via AIM to darksteel88 Send a message via MSN to darksteel88
Converting string to hex in VB express

So I'm trying to read in a specific file type (.pkm), which is translating to ASCII code normally (expected). I want to convert that ASCII code into hex. However, every attempt I have tried has failed, I often got a message saying I could not convert it to type long.

Code:
Dim file As String
        Dim data1 As String

        file = "D:\Documents and Settings\owner\Desktop\Pokemon\7-10-08_10ANNIV_ENG_Lugia.pkm"

        FileOpen(1, file, OpenMode.Binary)

        Do While Not EOF(1)
            Input(1, data1)
            Console.WriteLine(data1)
        Loop

        Console.ReadLine()
The Do While Not loop is fairly useless because I confirmed that it is all read in as a single string, and it is two lines long. I tried putting Hex(data1) above the writeline but I get the cannot convert to long error. Any help is appreciated.
darksteel88 is offline   Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here