开发者

Visual basic in program information storage

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜