public class BasicCalculation { public Int32 add(Int32 a, Int32 b) { return (a + b); } public Int32 substract(Int32 a, Int32 b) { return (a - b); } public Int32 multi(Int32 a, Int32 b) { return (a * b); } public Int32 divid(Int32 a, Int32 b) { return (a / b); } }
using MyCalculation; .....private void button1_Click(object sender, EventArgs e) { try { Int32 x = Convert.ToInt32(textBox1.Text); Int32 y = Convert.ToInt32(textBox2.Text); // Call dll MyCalculation.BasicCalculation madd = new BasicCalculation();//namespace.class Int32 z = madd.add(x, y);//class.method string ans = Convert.ToString(z); textBox3.Text = ans; } catch { textBox3.Text = "Wrong Input!"; } }
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: