开发者

Visual basic in program information storage

开发者 https://www.devze.com 2023-04-11 22:41 出处:网络
I\'m making an installer that needs to have information stored insid开发者_如何学Goe the exe itself.

I'm making an installer that needs to have information stored insid开发者_如何学Goe the exe itself.

I cannot use my.settings because it is stored outside the application and if it is changed and the exe is moved to another computer it will reset to default.

And I cannot use resources since I cannot add/edit resources after the application is build.

Is there any way I can store and change info even if the application is moved to another location?

Thanks for any help,


I solved it.

This code allowed me to add information to the end of the exe file without corrupting it.

 Dim encoding As New System.Text.ASCIIEncoding()
        Dim pid As Byte() = encoding.GetBytes(vbnewline & "Text to add")
        My.Computer.FileSystem.WriteAllBytes("file.exe", pid, True)

and then just read the last line with read line code within the program.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号