string.Format("{0,-30}{1:H:m:s}", p.ProcessName, p.StartTime)
程序代码:
private void buttonLook_Click(object sender, EventArgs e) { listBox1.Items.Clear(); Process[] processes; processes = Process.GetProcesses(); foreach (Process p in processes) { if (p.ProcessName != "Idle") { this.listBox1.Items.Add(string.Format("{0,-30}{1:H:m:s}", p.ProcessName, p.StartTime)); //this.listBox1.Items.Add(string.Format("{0:d}" ,p.ProcessName, p.StartTime)); //this.listBox1.Items.Add( string.Format("{0} - {1}", p.ProcessName, p.StartTime.ToString("l:h:m:s"))); } } }运行的时候显示的拒绝访问,是怎么回事