class Program
{
static void Main(string[] args)
{
calculator a = new calculator();
a.ADD(1, 2);
a.Minus(2, 1);
a.Multiply(2, 2);
a.Except(2, 2);
}
public class calculator
{
public int ADD(int a, int b)
{
return a + b;
}
public int Minus(int a, int b)
{
return a - b;
}
public int Multiply(int a, int b)
{
return a * b;
}
public int Except(int a, int b)
{
return a / b;
}
}
}
将
textbox.text=result.Add(first,second)
修改为
textbox.text=result.Add(first,second).toString();
就行了