我编写代码以显示从一个列表到另一个列表的任何进程,但出现错误!我错过了什么?
private void lsvproccess_SelectedIndexChanged(object sender, EventArgs e)
{
lsvitems.Items.Clear();
ListView lsvview = new ListView();
int index = lsvview.FocusedItem.Index; /*( get error in run time )*/
Process p = new Process();
p = (Process)process_array[index];
Detail_process(p); // detailing each process in right side listview
try
{
// calling Get_modules() method to acquire whole modules
// cooperating in this process
if (chbxmodule.Checked)
Get_modules(p.Modules);
}
catch (Win32Exception err)
{
MessageBox.Show(err.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}