将 asmx webservice 类对象定义为静态
将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上没有“静态类”..有静态成员(变量,方法)。静态类是 .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