PublicClass SimpleObjectClass SimpleObject Inherits System.MarshalByRefObject PublicFunction HelloWorld()Function HelloWorld(ByVal message AsString) AsString Return"Hello World"& message End Function End Class
host 程序代码
Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.RemotingConfiguration PublicClass HostClass Host PublicSharedSub Main()Sub Main() Dim channel AsNew Http.HttpServerChannel(6363) ChannelServices.RegisterChannel(channel) RegisterWellKnownServiceType(GetType(ObjectLib.SimpleObject), "simpleobject", Runtime.Remoting.WellKnownObjectMode.SingleCall) Console.WriteLine("started ok") Console.ReadLine() End Sub End Class