Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SessionCounter.asmx « server « standalone « Test « System.Web.Services « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 640f1bdf044e44b7db4390c1b1ff0ce1d576784d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<%@ WebService Language="c#" Class="Util.SessionCounter" %>  

 using System;  
 using System.Web;  
 using System.Web.Services;  
 using System.Web.SessionState;  
 namespace Util
 {  
    public class SessionCounter: System.Web.Services.WebService  
    {  
         [ WebMethod(EnableSession=true) ]  
         public void Reset()
         {  
            Session["counter"] = 0;
         }
	
         [ WebMethod(EnableSession=true) ]  
         public int AddOne()  
         {  
            if ( Session["counter"] == null )  
            { Session["counter"]=0; }  
            else  
            { Session["counter"]=(int)Session["counter"]+1; }  
   
            return (int)Session["counter"];  
   
          }
    }
  }