The Client application for calling Remote Object's method in C# is pretty simple and straight forward. The .NET Remoting System will intercept the client calls, forward them to the remote object, and return the results to the client. The Client Application have to register for the Remote Type also.
Here, in the Client application in C# , creating an instance of the Remote Type , RemoteTime Object , and call the method getTime() . Additionally it uses the configuration file Client.exe.config for the communication information for the Remoting Framework.
using System;
using System.Runtime.Remoting;
public class Client
{
public static void Main()
{
RemotingConfiguration.Configure("Client.exe.config");
RemoteTime remoteTimeObject = new RemoteTime();
Console.WriteLine(remoteTimeObject.getTime());
}
}csc /r:RemoteTime.dll Client.cs
csc /r:c:\src\RemoteTime.dll c:\src\Client.cs