I'm getting the error "an object reference is required for the non-static field, method, or property 'process.waitforexit()"
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;
using System.Diagnostics;
using System.IO;
namespace cpu_benchmark
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("C:\\Users\\Reghunaath A A\\source\\repos\\cpu benchmark\\resources\\benchmark result\\bench.exe");
Process.WaitForExit(100000);
//StreamReader sr1 = new StreamReader("C:\\Users\\Reghunaath A A\\source\\repos\\cpu benchmark\\resources\\benchmark result\\count.txt");
textBox1.Text = "hi";
}
}
}
.