Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 521.2k

Error - An object reference is required

Dec 2 2022 7:16 AM

Hi

Error - Error - An object reference is required for non static field , method or property Process.Kill

  I have below code and it is giving me above error on process.kill

public static void RunVideo(string videolink)
{
    var _process = new ProcessStartInfo(@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", videolink);
    Process.Start(_process);
    Process.Kill();
}

Thanks


Answers (11)