What's the difference in Process and System.Diagnostics.Process?

  • Thread starter Thread starter Steve Ricketts
  • Start date Start date
S

Steve Ricketts

I'm (obviously) new to C# but don't understand why if I instantiate a
Process object like:
Process proc = new Process();
and then type :
proc.
Intellisense shows me one list of options. But if I type:
System.Diagnosics.Process.
It shows a list of something else.

The Process definition is in import System.Diagnostics. I thought they
would have been the same thing but clearly, they're not. What's the
difference?

Thanks,

sr
 
Hi Steve,

The difference is Process. is showing static members, whereas proc. is
showing instance members

You get the same if you type Process. or System.Diagnostics.Process.
 
Makes sense. Thanks for the clarification!

sr

Morten Wennevik said:
Hi Steve,

The difference is Process. is showing static members, whereas proc. is
showing instance members

You get the same if you type Process. or System.Diagnostics.Process.

--
Happy Coding!
Morten Wennevik [C# MVP]


Steve Ricketts said:
I'm (obviously) new to C# but don't understand why if I instantiate a
Process object like:
Process proc = new Process();
and then type :
proc.
Intellisense shows me one list of options. But if I type:
System.Diagnosics.Process.
It shows a list of something else.

The Process definition is in import System.Diagnostics. I thought they
would have been the same thing but clearly, they're not. What's the
difference?

Thanks,

sr
 
I'm (obviously) new to C# but don't understand why if I instantiate a
Process object like:
Process proc = new Process();
and then type :
proc.
Intellisense shows me one list of options. But if I type:
System.Diagnosics.Process.
It shows a list of something else.

The Process definition is in import System.Diagnostics. I thought they
would have been the same thing but clearly, they're not. What's the
difference?

In addition to what Morten wrote, note that if you'd even just typed
simply "Process" instead of "System.Diagnostics.Process" in that scenario,
you'd see the same results. That is, what you're asking about isn't a
difference between "Process" and "System.Diagnostics.Process" (which, as
you say, are the same thing), but rather a difference between a variable
declared as "Process" and the type name "Process" itself.

Pete
 
Thanks, your comments are very helpful.

sr

Peter Duniho said:
In addition to what Morten wrote, note that if you'd even just typed
simply "Process" instead of "System.Diagnostics.Process" in that scenario,
you'd see the same results. That is, what you're asking about isn't a
difference between "Process" and "System.Diagnostics.Process" (which, as
you say, are the same thing), but rather a difference between a variable
declared as "Process" and the type name "Process" itself.

Pete
 
Back
Top