public static void Main() { DistanceCalculatorClient client = new DistanceCalculatorClient(); double result1 = client.CalcDistance( new Point { X = 0, Y = 0 }, new Point { X = 2, Y = 2 }); Console.WriteLine(result1); double result2 = client.CalcDistance( new Point { X = 3, Y = 4 }, new Point { X = -3, Y = -5 }); Console.WriteLine(result2); }
static void Main() { DistanceCalculatorClient dcc = new DistanceCalculatorClient(); double distance = dcc.CalcDistance(10, 10, 15, 15); Console.WriteLine(distance); }
static void Main() { var calculator = new DistanceCalculatorClient(); var result = calculator.CalcDistance( new Point() {X = 5, Y = 7}, new Point() {X = 8, Y = 10} ); Console.WriteLine("Distance between the two points {0:F2}", result); }
public static void Main() { var calc = new DistanceCalculatorClient(); var result = calc.CalcDistance(new Point { X = 1, Y = 1 }, new Point { X = 3, Y = 3 }); Console.WriteLine(result); using (var webClient = new WebClient()) { var res = webClient.DownloadString("http://localhost:32705/api/Calculator?ax=1&ay=1&bx=3&by=3"); Console.WriteLine(res); } }
static void Main() { Console.Write("Please enter the X value of the starting point: "); int startX = int.Parse(Console.ReadLine()); Console.Write("Please enter the Y value of the starting point: "); int startY = int.Parse(Console.ReadLine()); Console.Write("Please enter the X value of the ending point: "); int endX = int.Parse(Console.ReadLine()); Console.Write("Please enter the Y value of the ending point: "); int endY = int.Parse(Console.ReadLine()); using (var calc = new DistanceCalculatorClient()) { var result = calc.CalcDistance( new Point() { X = startX, Y = startY }, new Point() { X = endX, Y = endY } ); Console.WriteLine("The distance between point A({0}, {1}) and point B({2}, {3}) is: {4:F2} units", startX, startY, endX, endY, result); } }