Visual Studio Web 参考中的 URL 行为

发布于 2024-08-06 21:39:31 字数 105 浏览 4 评论 0原文

请有人准确解释一下 Visual Studio 中 Web 引用的 URL 行为(静态或动态)属性的用途。

我相信它会影响 Web 服务的 URl 的存储位置,但我没有清楚的理解。

Please can some one explain exactly what the URL Behaviour (Static or Dynamic) property for a Web Reference in Visual Studio is for.

I believe it affects where the URl for the Web Service is stored but I don't have a clear understanding.

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

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

发布评论

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

评论(2

ζ澈沫 2024-08-13 21:39:31

这是更完整的答案。

动态会自动添加指定 Web 服务 URL 的设置。是的,可以通过 app.config 进行管理,但该设置必须位于 app.config 的特定位置。

Static 使代理的构造函数将 Url 属性初始化为其原始值。

因此,如果您有自己的 URL 处理(例如,从数据库检索 URL 或驻留在 app.config 的另一部分中),URL 行为 必须是静态 并稍后在您的自定义代码中进行更改。

Here's a bit more complete answer.

Dynamic automatically adds a setting that specifies Web Service URL. Yes, it can be managed through app.config, but the setting must reside in a specific place of app.config under <applicationSettings>.

Static makes the proxy's constructor to initialize Url property to its original value.

So if you have your own URL handling (e.g. the URL is retrieved from the database or resides in another section of app.config), URL Behaviour must be Static and changed later in your custom code.

明天过后 2024-08-13 21:39:31

我相信它会影响 URl 的位置
Web 服务已存储,但我没有
有一个清晰的认识。

这是正确的。

如果将其设置为动态,之后您可以更改 Web 服务的 url (WebService.Url)。 详细信息

I believe it affects where the URl for
the Web Service is stored but I don't
have a clear understanding.

That's right.

If you set it to dynamic, afterwards you can change url of web service (WebService.Url). Details here.

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