将数据从字符串传输到数据视图
本文关键字:数据 视图 传输 字符串 | 更新日期: 2023-09-27 17:59:57
我正试图将数据从字符串传输到数据视图控件,有人能演示一下如何做到这一点吗:
private void testing_Click(object sender, EventArgs e)
{
// Get a ScheduledTasks object for the computer named "DALLAS"
string machineName = (@"''" + System.Environment.MachineName);
ScheduledTasks st = new ScheduledTasks(machineName);
// Get an array of all the task names
string[] taskNames = st.GetTaskNames();
st.Dispose();
}
for (int i = 0; i < taskNames.Count; i++)
{
dataGridView1.Rows.Add(taskNames[i]);
}