使应用程序成为“单个文件”并删除 XML 配置文件

发布于 2024-10-09 19:34:38 字数 230 浏览 3 评论 0原文

我有一个非常简单的应用程序,它使用 webService 将数据传输到我的服务器数据库。现在,对我来说非常重要的是,将此应用程序保留为一个文件,并且不需要它工作所需的某些 XML 文件,但情况就是如此。我认为 XML 文件保存了该 webService 的信息,因此如果没有它,应用程序就会崩溃。有没有办法让应用程序在没有此 XML 文件的情况下工作,或者将 XML 放入 exe 存档中?

任何实现这一目标的方法都非常值得赞赏。

I have this pretty simple application, it uses a webService to transfer data to my servers DataBase. Now it is very important for me to keep this application as one single file, and not having some XML files needed for it to work, but this is the case. I think the XML file holds the information to this webService, so without it the application crashes. Is there a way to get the application to work without this XML file, or a way to put the XML inside the exe archive?

Any way to accomplish this is much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-10-16 19:34:38

听起来你想做的是 以编程方式调用 Web 服务(无需 Visual-Studio 添加的 Web 引用)。另一个可能有用的链接此处

我想 app.config 文件中存在的所有配置设置都可以以一种或另一种方式进行硬编码,各个配置部分只需要不同程度的独创性来实现它。

It sounds like what you want to do is invoke a web service programmatically (without a Visual-Studio-added web reference). Another potentially useful link here.

I imagine all of the configuration settings that exist in an app.config file can be hard-coded in one way or another, the various config sections will just require varying degrees of ingenuity to make it happen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文