|
public static int Main(string[] args)+ s6 O& V6 l. V
{; {, P4 r6 G! ~' V+ o9 b
int retValue = 0;
7 H, L: e) a. y6 p& C9 P: ? try
# j: u) @$ P# n8 y1 s P) U {+ i1 M7 I$ G& ], w; w8 }+ o( b) D
theProgram = new Program(); V' d. v4 z8 V( N
Part dispPart = theSession.Parts.Display;8 F1 }6 L6 S, W. ?1 ?7 J2 n% p
string filePath = dispPart.FullPath;//获得文件全路径
0 H9 ?/ ?" P/ e //UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Information, str);# c7 s% B. J- z: y1 \/ e5 V) `9 _) Z
ProcessStartInfo psi = new ProcessStartInfo("Explorer.exe");//还是调用进程打开文件夹
1 F1 V' Q) d7 H2 w* l psi.Arguments = "/e,/select," + filePath;
5 t; V" U5 v* J& k Process p;' I3 _6 j- b* g% S% x2 \# e+ G
p=Process.Start(psi);//启动进程打开
+ t r- H. p6 R1 W6 Y //TODO: Add your application code here
' Q' v& ]- H6 _8 Q7 ` p.WaitForInputIdle(2000);//等2秒钟
3 I$ P- b* I7 ^4 z" N u5 X% r! i! B //p.Kill();
! O8 O& C. c' w( t: S: ^1 c theProgram.Dispose();
$ U2 W* c) a1 n. h, W8 r; r }
u6 k9 F- }4 w( n% j catch (NXOpen.NXException ex)8 ?( ~4 ~+ C! G% g
{
S8 {, p4 b* j. _$ N // ---- Enter your exception handling code here -----
6 J! G6 o$ B; I: o
; n' u i4 {! L7 j6 K6 K. r" V- l }
! I. F+ ?6 ~0 ]" X, I: b0 m! i return retValue;
6 |, T: Z0 A2 f1 L h# V. {4 j } |
|