|
public static int Main(string[] args)
+ ]$ [+ D# U4 v: F0 e {
: X- m; |1 ]+ @0 x int retValue = 0;+ V2 |( U7 w' V5 _2 ?
try
0 M2 E. V8 c, `! r {
- c$ }/ I! q# c, u) `# _2 t; D3 A theProgram = new Program();
* Q+ m1 T/ _, E, U: h+ ^ Part dispPart = theSession.Parts.Display;% X' g+ H8 z6 ~8 P6 S
string filePath = dispPart.FullPath;//获得文件全路径
; Z: g5 f( t" u7 ~ Y2 _9 |8 N* T* L //UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Information, str);( Y! {. i- g) X& b
ProcessStartInfo psi = new ProcessStartInfo("Explorer.exe");//还是调用进程打开文件夹
# [1 M+ s9 _0 Q0 J6 Q" W+ C psi.Arguments = "/e,/select," + filePath;
E$ h+ m! U! C3 T# L | Process p;
7 l, q: @& S: R8 x& R p=Process.Start(psi);//启动进程打开& {2 w* w6 y- J0 J
//TODO: Add your application code here , [- |; {4 w# P$ b3 U: c
p.WaitForInputIdle(2000);//等2秒钟
0 o+ e/ s* [: [/ Y5 r9 h //p.Kill();
& L5 o! q) W0 {+ Y5 G4 H/ h+ u theProgram.Dispose();& V5 n2 t% k% A, d5 k3 K! G2 @/ i
}! f5 U5 t0 S1 @, F0 V
catch (NXOpen.NXException ex)0 _5 Z! J1 f! n k+ n% k9 ^
{: {) {- F3 m9 T6 {- E' [
// ---- Enter your exception handling code here -----
( K1 V1 i; q; W0 `3 I# w3 ~0 a7 ^: V* Q3 I2 @2 e; y4 t! J F
}) R. t5 R; x i, T! |
return retValue;
* g( y V A; a } |
|