本文整理汇总了C#中CalculatorClient.PowerOf方法的典型用法代码示例。如果您正苦于以下问题:C# CalculatorClient.PowerOf方法的具体用法?C# CalculatorClient.PowerOf怎么用?C# CalculatorClient.PowerOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalculatorClient
的用法示例。
在下文中一共展示了CalculatorClient.PowerOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var calculatorClient = new CalculatorClient();
var operation = args[0];
var number1 = int.Parse(args[1]);
var number2 = int.Parse(args[2]);
if (string.Equals(operation, "-Add", StringComparison.OrdinalIgnoreCase))
{
var resultAdd = calculatorClient.Add(number1, number2);
Console.WriteLine("resultAdd: {0}", resultAdd);
}
else if (string.Equals(operation, "-Subtract", StringComparison.OrdinalIgnoreCase))
{
var resultSubtract = calculatorClient.Subtract(number1, number2);
Console.WriteLine("resultSubtract: {0}", resultSubtract);
}
else if (string.Equals(operation, "-Multiply", StringComparison.OrdinalIgnoreCase))
{
var resultMultiply = calculatorClient.Multiply(number1, number2);
Console.WriteLine("resultMultiply: {0}", resultMultiply);
}
else if (string.Equals(operation, "-Divide", StringComparison.OrdinalIgnoreCase))
{
var resultDivide = calculatorClient.Divide(number1, number2);
Console.WriteLine("resultDivide: {0}", resultDivide);
}
else if (string.Equals(operation, "-PowerOf", StringComparison.OrdinalIgnoreCase))
{
var resultPowerOf = calculatorClient.PowerOf(number1, number2);
Console.WriteLine("resultPowerOf: {0}", resultPowerOf);
}
else
{
Console.WriteLine("Invalid operation entered");
throw new ArgumentException("Invalid operation entered");
}
calculatorClient.Close();
// Console.WriteLine("Press <ENTER> to stop client");
// Console.ReadLine();
}