惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - yunshu

(转帖)C/S、B/S及三层结构漫谈 TP-Link 配置(转帖) 如何用VSS VS2005重置按钮代码 asp.net 2.0 网站导航控件 WEB自定义控件小记 VS2005 DataGridView 和 GirdView 横向大比拼 web.config中连接字符串与数据库登陆方式的联系 转帖-win2003各版本的区别 您没有调试该服务器的权限,验证您是服务器“Debugger Users”组的成员 错误:未将对象引用设置到对象的实例 在绑定DataGrid控件,做添加删除时遇到问题(数组越界) visual studio.net已检测到指定的web服务器运行的不是asp.net1.1版。 request('id')语句,返回的是什么类型的数据 如何在DataSet中追加记录 怎样添加本地web引用 创建XML文件的两种方法 枚举类型是什么意思,怎么用? 什么是DOM?
[WebMethod] 是什么意思?
yunshu · 2008-04-10 · via 博客园 - yunshu

在一个WebService类中,一个Public的方法能否被调用者访问就取决于这个方法是否是一个“WebMethod”,是不是就要看一下这个方法的属性了,加上[WebMethod]属性的公有方法就可以被访问,而没有加这个属性的方法就是不能被访问的。
 
WebMethod有6个属性:
.Description
.EnableSession
.MessageName
.TransactionOption
.CacheDuration
.BufferResponse

[WebMethod()]  括号里面可以增加属性设置,上面列出的是可以设置的属性。

比如WebMethod(EnableSession = true)就表示在你的这个WebMethod方法中可以访问session中的值

默认情况下WebMethod不能访问session中的值