String转int int iAge = int.Parse(age);
int转String textBoxRes.Text = num.ToString();
编写一个应用程序,完成数字的加法运算。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int num = int.Parse(textBoxNum1.Text) + int.Parse(textBoxNum2.Text);
textBoxRes.Text = num.ToString();
}
}
}