Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 18 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Why can't I acess a process?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 demongunsman   Members   -  Reputation: 136

Like
0Likes
Like

Posted 03 February 2013 - 07:36 PM

As you can see in my code I included System.Diagnostics. The purpose of this program is to get the current process and output it to the console. I am trying to access Process.GetCurrentProcess    on line 14  .  Also, as you can see, I can only access Process.Program   . Why is it that I can't use:

 

Process.GetCurrentProcess(); and all of the other functions of the Process Class.

 

 

 

166nq81.jpg



Sponsor:

#2 fastcall22   Crossbones+   -  Reputation: 6251

Like
3Likes
Like

Posted 03 February 2013 - 07:45 PM

Because your program's namespace is also called "Process", you'll need to use "System.Diagnostics.Process" to resolve the diambiguity between System.Diagnostics.Process and Process.

TL;DR: Don't name your program "Process".
gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#3 demongunsman   Members   -  Reputation: 136

Like
0Likes
Like

Posted 03 February 2013 - 07:48 PM

Ahhh that seems like a very logical answer. *Voted up* . Yea didn't notice that because the name of the tutorial I am watching is called process. Thank you!



#4 demongunsman   Members   -  Reputation: 136

Like
0Likes
Like

Posted 03 February 2013 - 07:54 PM

By the way, does this function return a string. for example can I do this:

 

string myString = Process.GetCurrentProcess();



#5 Cornstalks   Crossbones+   -  Reputation: 7003

Like
1Likes
Like

Posted 03 February 2013 - 08:11 PM

By the way, does this function return a string. for example can I do this:

 

string myString = Process.GetCurrentProcess();

If you google the function and look up the documenation, you can see it returns a Process, not a string.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS