Здравствуйте, pyvadminpyv, Вы писали:
...
P>В чем может быть проблема?
У меня без проблем работает на W2K3 + FW1.1
Client.vb
Imports System
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Module Module1
Sub Main()
Dim channel As New TcpClientChannel
ChannelServices.RegisterChannel(channel)
RemotingConfiguration.RegisterWellKnownClientType(GetType(RemoteClass), _
"tcp://localhost:1234/clock")
Dim clk As New RemoteClass
Console.WriteLine(clk.RemoteProperty)
Console.WriteLine("Enter - Exit")
Console.ReadLine()
End Sub
End Module
Server.vb
Imports System
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Module Module1
Sub Main()
Dim channel As New TcpServerChannel(1234)
ChannelServices.RegisterChannel(channel)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemoteClass), _
"Clock", WellKnownObjectMode.SingleCall)
Console.WriteLine("Enter - Exit")
Console.ReadLine()
End Sub
End Module
RemoteableType.vb
Imports System
Public Class RemoteClass
Inherits MarshalByRefObject
Public ReadOnly Property RemoteProperty() As String
Get
Return "Time on server now: " & DateTime.Now.ToLongTimeString
End Get
End Property
End Class
Транслировать:
vbc /t:library /r:System.dll /out:RemoteableType.dll RemoteableType.vb
vbc /r:System.Runtime.Remoting.dll /r:System.dll /r:RemoteableType.dll /out:Server.exe Server.vb
vbc /r:System.Runtime.Remoting.dll /r:System.dll /r:RemoteableType.dll /out:Client.exe Client.vb
Peter