|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique / `9 B2 X3 l' \+ |1 q& ? L
On the client side use the vault control to write to a text file. " U( s* M! U" K
JavaScript 3 G+ |" \. [) ?7 G! l$ c; y
with (top.aras.vault)
" Y2 {& `" G R{ ; x. Z1 x4 W" o
fileCreate(filePath); ' e8 `8 y, c3 }% M7 F
fileOpenAppend(filePath);
$ y8 d) }/ n* e/ y C8 P1 ] fileWriteLine('<AML><Item type="MyItemType"/></AML>'); W) k1 r* C; V% ?0 y
fileClose(); * ?# A5 e, \( `4 I/ Q3 N6 p
} 4 w! w' G9 n: z( W: L: C* u: V+ a
Technique . F* r9 J6 b S" o& l
On the server side use the File and StreamWriter namespaces to write to a text file. * `4 ]2 u* X9 _! G
C#
1 P- U( R ^+ l, OInnovator myInnovator = this.newInnovator(); 0 N0 T9 p- O5 ?+ P
6 h/ E$ a6 B3 I// Save the results to a file.
2 z9 j" J+ j' O& J( e- \( tstring path = myInnovator.MapPath("temp/yoyo.txt"); 9 Y, T. m, Q) c5 N5 X8 v g% f4 @
try : M" c5 C' @+ E7 o7 d( ^# j
{
1 }% x4 d/ J0 \0 K E1 E if (File.Exists(path)) File.Delete(path);
1 t# z( B3 O1 v. P$ C StreamWriter sw = File.CreateText(path);
) V' Z1 [1 b+ [2 Z sw.Write(this.dom.InnerXml); : n7 ^ s# }9 K0 i, w! `8 T# a
sw.Close(); 5 {! L1 D/ Q. w* ]
} - t2 s7 R! e2 T0 i4 ]0 T
caTCh (Exception e) " a2 L6 k5 x! j2 \; c5 ?
{ / [8 ?( ?' B: U) T' d
return myInnovator.newError(e.Message); 4 L& R: D b+ L3 G: P6 _* O6 d
}
& e( b2 [' U% q+ S, Creturn myInnovator.newResult("ok"); $ l9 n& E( Z1 v2 D* i
; _) A1 @7 c* R X: s4 D( Q2 J |
|