将 asmx webservice 类对象定义为静态

发布于 2024-08-24 00:16:05 字数 218 浏览 3 评论 0原文

将 Webservice 类对象实例声明为静态是否更好,因为 .asmx webservice 类仅具有静态方法。

我想要的是我在 aspx Page Behind Class 中声明并实例化 webservice asmx 类为静态。

在该页面上的每个事件调用中,我都可以针对 Web 服务方法执行操作。

它对性能有好处吗?

谢谢乌萨马

is it better to declare Webservice class object instances as static as the .asmx webservice classes have only static methods.

what i want is that i declare and instantiate webservice asmx class as static in aspx Page Behind Class.

and on every event call on that page i could perform operation against webservice methods.

is it beneficial in terms of performance?

Thanks

Usama

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

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

发布评论

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

评论(1

塔塔猫 2024-08-31 00:16:05

实际上没有“静态类”..有静态成员(变量,方法)。静态类是 .net2.0 强制每个成员都是静态的。就是这样。除了事实之外:
“静态”和“实例”是相反的——你不能实例化静态类。 – 约翰·桑德斯 3 月 11 日 3:18

Actually there are no "static classes" .. there are static members (variables,methods). static class is sth of .net2.0 that forces every member to be static. and that's about it. In addition to the fact:
"static" and "instance" are opposites - you can't instantiate a static class. – John Saunders Mar 11 at 3:18

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