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

  1. 
  2. Imports System
  3. Imports System.Runtime.Remoting
  4. Imports System.Runtime.Remoting.Channels.Http
  5. Imports Microsoft.VisualBasic
  6.  
  7. Imports Hello
  8.  
  9.  
  10.  
  11. Public Class HelloNew
  12.     
  13.     Public Shared Sub Main()
  14.         Console.WriteLine(".NET Remoting Sample - HelloGetObj")
  15.         Console.WriteLine("-------------------------------------" + ControlChars.Cr)
  16.         
  17.         Dim name As [String] = "Bill"
  18.         Dim configFilename As [String] = "HelloGetObj.exe.config"
  19.         Dim type As Type = GetType(HelloService)
  20.         Dim url As [String] = "http://localhost:8000/RemotingHello/HelloService.soap"
  21.         
  22.         Console.WriteLine("Configuring Remoting from {0}", configFilename)
  23.         RemotingConfiguration.Configure(configFilename)
  24.         
  25.         Console.WriteLine("Obtaining Proxy for HelloService, using Activator.GetObject")
  26.         Dim helloService As HelloService = CType(Activator.GetObject(type, url), HelloService)
  27.         
  28.         Console.WriteLine("Calling HelloService.ReturnGreeting({0})", name)
  29.         Dim greeting As [String] = helloService.ReturnGreeting(name)
  30.         
  31.         Console.WriteLine("HelloService.ReturnGreeting returned: {0}", greeting)
  32.     End Sub 'Main
  33. End Class 'HelloNew
  34.  
  35.