How can I inject a file into an EXE at runtime and reference the file during program operation?

后端 未结 5 1317
时光取名叫无心
时光取名叫无心 2021-02-06 11:22

I\'d like a user to download an exe from my website, where (synchronously upon download) an XML file is injected into this application. This XML file contains a public key, and

5条回答
  •  佛祖请我去吃肉
    2021-02-06 11:57

    To inject the file add it to your project. Then right-click on it in the solution explorer, go to properties, and change its type to EmbeddedResource.

    To load it at run-time use Assembly.GetManifestResourceStream(). Read more here: http://msdn.microsoft.com/en-us/library/xc4235zt.aspx.

提交回复
热议问题