Editing a Binary File

Rich Locus 61 Reputation points
2020-12-06T17:42:43.163+00:00

Hello: I have an older version of Visual Studio (2010). Are there examples posted on this forum of using Visual Basic to Open a Binary file, search for a character string (in either hex or ASCII), update the string (with the ability to add characters - i.e. the search finds a 2 character string, and replace it with a 5 character string, making the file longer), and save the file with a new name?

Thanks,

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

Accepted answer
  1. Dylan Zhu-MSFT 6,426 Reputation points
    2020-12-07T05:35:12.047+00:00

    Hi RichLocus,

    You could refer to this document: How to: Read From Binary Files in Visual Basic, and related interfaces here: FileStream Class and FileStream.Read Method.

    Best Regards, Dylan

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our * *documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.