理解WebMethodAttribute类

ZDNet软件频道 时间:2002-12-19 作者:techmail 代码页 |  我要评论()
本文关键词:
<WebMethod(BufferResponse:=False)>
Public Function GetLargeDataSet() As DataSet ' code to retrieve and return a large amount of data End Function
<WebMethod(CacheDuration:=60)> _
Public Function CachedFunction(ByVal Param1 As Integer, ByVal _ Param2 As Integer) As Integer Return Param1 + Param2 End Function

<WebMethod(Description:="This method returns a string")>
Public Function GetString() As String Return "A String" End Function
<WebMethod(EnableSession:=True)>
Public Function TestSession() As String If Session("UserState") Is Nothing Then Session("UserState") = True Return "This is the first time you have called this function" Else Return "You have already called this method once during your session" End If End Function
<WebMethod(MessageName:="MultiplyIntegers")>
Public Function Multiply(ByVal Param1 As Integer, ByVal param2 As _ Integer) As Integer End Function
<WebMethod(MessageName:="MultiplyLongs")>
Public Function Multiply(ByVal Param1 As Long, ByVal Param2 As _ Long) As Long End Function
    <WebMethod(TransactionOption:=TransactionOption.RequiresNew)>
Public Sub TransactionFunction() ' Code to perform multiple calls that form a single atomic transaction End Sub

百度大联盟认证黄金会员Copyright© 1997- CNET Networks 版权所有。 ZDNet 是CNET Networks公司注册服务商标。
中华人民共和国电信与信息服务业务经营许可证编号:京ICP证010391号 京ICP备09041801号-159
京公网安备:1101082134