C# web service that can't remember values.

Discussion in 'OT Technology' started by VBGOD, Jul 5, 2003.

  1. VBGOD

    VBGOD Guest

    Client side (Program)
    Line 1: Dim Test As New D_WebReference.Service_D() 'Create reference to object
    Line 2: Test.DoThis() 'Invoke this method.
    Line 3: MsgBox(Test.Message) 'Display this properties value.


    Server side (Web service)
    Line 1: private string l_message = ""; //declare variable in the declarations.
    Line 2:// Invoke this method. Give "l_message" a value.
    Code:
    		[WebMethod]
    		public void DoThis()
    		{
    			l_message="Save this!";
    		}
    
    Line 3:// The property "Message" should return "l_message".
    Code:
    [WebMethod]
    		public string Message()
    		{
    			return l_message;
    		}
    
     
  2. VBGOD

    VBGOD Guest

    Got it from somewhere else!

    private static string l_message = "";
     

Share This Page