无法在system.diagnosis中获取startinfo方法

use*_*440 0 c#

Error   1   'WindowsFormsApplication1.Process' does not contain a definition for 'StartInfo' and no extension method 'StartInfo' accepting a first argument of type 'WindowsFormsApplication1.Process' could be found (are you missing a using directive or an assembly reference?) 
D:\Anas Work\ANAS FOLDER\4th Semester\Introduction To operating System\Programs\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs  24  16  WindowsFormsApplication1
Run Code Online (Sandbox Code Playgroud)

我的代码如下:

process p1= new process();
p1.startinfo.filename="chorome.exe";
Run Code Online (Sandbox Code Playgroud)

Jon*_*eet 5

正如Habib在一篇现已删除的评论中所提到的那样,看起来你已经宣布了自己的Process,这会让事情搞得一团糟.我建议重命名该反正只是为了避免混淆,但我个人认为这是最明显的从创建开始一个新的进程ProcessStartInfo,然后再使用该启动过程-而不是在现有范围内设置它Process的对象,然后调用Start:

var info = new ProcessStartInfo
{
    FileName = "chrome.exe",
    ...
};
var process = Process.Start(info);
Run Code Online (Sandbox Code Playgroud)

(另请注意,C#区分大小写,因此您的示例代码也不正确.)