2017年3月23日 星期四

asp.net webmethod session

Using ASP.NET Session State in a Web Service
---
How can I access session in a webmethod?
---
重點底下寫法:
  1. EnableSession:=True
---
  1. _
  2. Public Function IncrementSessionCounterX() As Integer
  3. Dim counter As Integer
  4. If Context.Session("Counter") Is Nothing Then
  5. counter = 1
  6. Else
  7. counter = Context.Session("Counter") + 1
  8. End If
  9. Context.Session("Counter") = counter
  10. Return counter
  11. End Function

沒有留言:

張貼留言