开发者

C#.net embedded editable string

开发者 https://www.devze.com 2023-03-27 10:44 出处:网络
I making an application launcher, Launcher.exe. I\'m trying to have it load a config file from a URL. The URL value needs to be dynamic (so other people can use the app, loading a different URL) but a

I making an application launcher, Launcher.exe. I'm trying to have it load a config file from a URL. The URL value needs to be dynamic (so other people can use the app, loading a different URL) but also be able to have the same value on other computers (with out a config file, single exe) Is there any way I can edit an embedded resource. Even if I have a separate exe that just edits launcher.exe embedded resource. I'v been Googleing that for that last 2 hrs.

Or is there a way I can edit a value in the program itself, that would be the same from computer to computer.

//Something like this: 
//open app.exe on comp1 
//setting --> URL = "http://stackoverflow.com"  
//Change/Save it to "http://google.com"
//close app.exe put app.exe on a flash-drive 
//open app.exe on Comp2
//setting --> URL = "http://google.com"

or

//open app.exe
//setting --> URL = "http://stackoverflow.com"
//close app.exe 
//open settingchange.exe
//edits app.exe setting
//setting --> URL = "http://stackoverflow.com" 
//Change/Save it to "http://google.com"
//close settingchange.exe
//open app.ex开发者_如何学Pythone
//setting --> URL = "http://google.com"

How can I do this with no config files.


You mentioned you could have a second exe that changes the first one. You could do that with Mono.Cecil, but it will not be particularly easy (due to a chronic lack of examples and documentation). Here's an example on Justin Etheridge's blog that you may be able to tweak to change your URL on the fly directly in the compiled code.


Use the settings tab in Properties. It stored the information in the AppData on each unique computer.

0

精彩评论

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