home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / client_vb_8________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Text File  |  2001-08-21  |  2.6 KB  |  74 lines

  1. 
  2. Imports System
  3. Imports System.IO
  4. Imports System.Text
  5. Imports System.Runtime.Remoting
  6. Imports System.Security.Policy
  7. Imports System.Threading
  8. Imports Microsoft.VisualBasic
  9.  
  10. Imports CAOLibrary
  11.  
  12.  
  13.  
  14. Public Class Client
  15.     
  16.     Public Shared Function Main() As Integer
  17.         Dim result As Boolean = True
  18.         Dim totalNumber As Integer = 0
  19.         
  20.         ' Load the Http Channel from the config file
  21.         RemotingConfiguration.Configure("Client.exe.config")
  22.         
  23.         Dim counterPiet As New Counter("Piet")
  24.         
  25.         ' Retrieve the name from the activated object
  26.         Console.WriteLine(("Count.name: " + counterPiet.name))
  27.         
  28.         ' Perform a series of calls on the object
  29.         Dim i As Integer
  30.         For i = 0 To 2
  31.             Console.WriteLine("counterPiet.DoWorkWithNumber (100)")
  32.             result = counterPiet.DoWorkWithNumber(100)
  33.             totalNumber = counterPiet.TotalNumber
  34.             Console.WriteLine("After DoWorkWithNumber Total Number is {0}" + ControlChars.Cr, totalNumber)
  35.         Next i
  36.         
  37.         Dim counterJohn As New Counter("John")
  38.         
  39.         ' Retrieve the name from the activated object
  40.         Console.WriteLine(("Counter.name: " + counterJohn.name))
  41.         
  42.         ' Perform a series of calls on the object
  43.         For i = 0 To 2
  44.             Console.WriteLine("counterJohn.DoWorkWithNumber (50)")
  45.             result = counterJohn.DoWorkWithNumber(50)
  46.             totalNumber = counterJohn.TotalNumber
  47.             Console.WriteLine("After DoWorkWithNumber Total Number is {0}" + ControlChars.Cr, totalNumber)
  48.         Next i
  49.         
  50.         Dim counterBill As New Counter("Bill")
  51.         
  52.         ' Retrieve the name from the activated object
  53.         Console.WriteLine(("Counter.name: " + counterBill.name))
  54.         
  55.         counterBill.TotalNumber = 1000
  56.         
  57.         Dim numbers As Integer() =  {50, 25, 100}
  58.         
  59.         Console.WriteLine("counterBill.DoWorkWithNumbers ({0})", numbers)
  60.         result = counterBill.DoWorkWithNumbers(numbers)
  61.         totalNumber = counterBill.TotalNumber
  62.         Console.WriteLine("After DoWorkWithNumbers Total Number is {0}" + ControlChars.Cr, totalNumber)
  63.         
  64.         Dim strNumbers As [String]() =  {"15", "45", "5"}
  65.         
  66.         Console.WriteLine("counterBill.DoWorkWithNumbers ({0})", strNumbers)
  67.         result = counterBill.DoWorkWithNumbers(strNumbers)
  68.         totalNumber = counterBill.TotalNumber
  69.         Console.WriteLine("After DoWorkWithNumbers Total Number is {0}" + ControlChars.Cr, totalNumber)
  70.         
  71.         Return 0
  72.     End Function 'Main
  73. End Class 'Client
  74.