static void Main(string[] args) { ChannelFactory <IDiskInfo> factory = new ChannelFactory <IDiskInfo>( new WSHttpBinding(), new EndpointAddress("http://*****:*****@"C:\Users\SSASHKOO\source\repos"); if (result != null) { foreach (string str in result) { Console.WriteLine(str); } } //Console.WriteLine("result: {0}", result); Console.WriteLine("Press <ENTER> to exit...\n"); Console.ReadLine(); factory.Close(); }
static void Main(string[] args) { ChannelFactory <IDiskInfo> factory = //new ChannelFactory<IDiskInfo>(new WSHttpBinding(), new ChannelFactory <IDiskInfo>(new NetTcpBinding(), new EndpointAddress("net.tcp://*****:*****@"D:\"; string[] results = channel.GetDiskInfo(address); Console.WriteLine("Содержимое папки {0}", address); if (results != null) { foreach (var result in results) { Console.WriteLine("{0} ", result); } } else { Console.WriteLine("Папка не найдена!"); } Console.WriteLine("Для завершения нажмите < ENTER >\n"); Console.ReadLine(); factory.Close(); }
static void Main(string[] args) { ChannelFactory <IDiskInfo> factory = new ChannelFactory <IDiskInfo>( new WSHttpBinding(), new EndpointAddress("http://localhost/DiskInfo/EndP1")); IDiskInfo chanell = factory.CreateChannel(); string diskName = "D"; string totalSpace = chanell.TotalSpace(diskName); string freeSpace = chanell.FreeSpace(diskName); Console.WriteLine("Disk {0}: \nTotal Space: {1}\nFree Space: {2}", diskName, totalSpace, freeSpace); Console.WriteLine("Push any key for exit"); Console.ReadKey(); factory.Close(); }
public void PhysicalDiskChanged(IDiskInfo pDiskInfo) { // throw new NotImplementedException(); }