// Compile as: mcs prog.cs -r:System.Runtime.Remoting using System; using System.IO; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Http; //using System.Runtime.Remoting.Dll; class MainClass { public static void Main(string[] args) { Console.WriteLine("Hello World!"); ChannelServices.RegisterChannel(new HttpChannel(8080)); RemotingConfiguration.RegisterWellKnownServiceType(typeof(DirectoryLister), "dir", WellKnownObjectMode.Singleton); Console.WriteLine("Press Enter to exit"); Console.ReadLine(); } } public class DirectoryLister : MarshalByRefObject { public string [] ListDirectory(string path) { return Directory.GetFileSystemEntries(path); } }