注释代码!
帮我注释下面这段代码 ~ 详细点的!
private void button1_Click(object sender, EventArgs e)
{
try
{
rows = dataGridView1.Rows.Count - 1;
id =new int[rows];
priority =new int [rows];
cputime =new int [rows];
alltime=new int [rows];
startblock = new int[rows];
blocktime =new int [rows];
state=new string [rows];
for (int r = 0; r < rows; r++)
{
id[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[0].Value);
priority[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[1].Value);
cputime[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[2].Value);
alltime[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[3].Value);
startblock[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[4].Value);
blocktime[r] = Convert.ToInt32(dataGridView1.Rows[r].Cells[5].Value);
state[r] = Convert.ToString(dataGridView1.Rows[r].Cells[6].Value);
}
}
catch(Exception se)
{
MessageBox.Show(se.Message);
------解决方案--------------------
Convert.ToInt32 转换成INT型 其他没什么难的 楼主在VS2005里面智能感知都能看明白了。