Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.0
Member 'System.Diagnostics.Process.Start(string, string)' cannot be accessed with an instance reference; qualify it with a type name instead
 
this error in the following code in line 4.
 

line 1 System.Diagnostics.Process obj = new System.Diagnostics.Process();
line 2 obj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
line 3 obj.WaitForExit();
line 4 obj.Start("C:\\Project\\emgscan.exe", sorce.FullName);
Posted 25-Apr-10 18:01pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Like the error message says: The start method can not be called for a specific instance of a Process object. Call it like a static method:
 
System.Diagnostics.Process.Start( params );
 
If you need more control over the started process, use the overloaded method which takes a ProcessStartInfo object as input, rather than just the string filename. Hope this helps!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 380
1 OriginalGriff 250
2 DamithSL 210
3 Kornfeld Eliyahu Peter 200
4 Peter Leow 95
0 OriginalGriff 7,315
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,917
3 Maciej Los 4,866
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 26 Apr 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100