|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 5 i1 E) l: |, ?; t9 k
On the client side use the vault control to write to a text file. 0 P5 v' M7 E; F( ^2 ]2 `: ]2 n
JavaScript
# `' g. h5 a9 ?2 w1 Iwith (top.aras.vault)
4 r/ j4 Y2 ?2 C' _0 V- i{
. J* w3 Z9 Y: S/ d6 h fileCreate(filePath);
( z0 D1 `3 ~# } \ fileOpenAppend(filePath);
' |, n `; ~# f' \/ Z3 X: l, K fileWriteLine('<AML><Item type="MyItemType"/></AML>');
' G; m/ Z$ I9 [ O* R fileClose();
1 I8 \" V, ~8 O2 L' c/ W% ]} 2 h: c7 X8 o$ {9 {, [) i! t2 l
Technique & W& P( b7 Z5 \, v0 K- Z9 l* a
On the server side use the File and StreamWriter namespaces to write to a text file. . q6 z+ P; ~! P9 A$ q2 V
C#
) O7 c5 f6 N! w' J+ o; J- {Innovator myInnovator = this.newInnovator(); ( ~$ G3 g7 h A; ?) s9 W. y# `& `
9 f( B6 P3 i4 o% e, Q
// Save the results to a file.
4 s" ^! M5 `* `. z4 ]9 {string path = myInnovator.MapPath("temp/yoyo.txt");
4 X3 ^3 K/ k3 {8 u/ c2 c5 stry % w5 g) K/ l, o8 l
{
+ I, z. ^' H# Z if (File.Exists(path)) File.Delete(path);
9 i" X: q9 Q4 M0 g: l- W StreamWriter sw = File.CreateText(path); % L& ]# ]' n6 Z7 }* l, J1 ~" e
sw.Write(this.dom.InnerXml);
7 W/ _- s6 \: k6 } {6 X# j7 B" V sw.Close(); ! t9 t0 E4 f E! r" p
} + h8 d/ e$ {: R4 v
caTCh (Exception e) / e# K5 R& F0 G3 Y; H( J
{
E3 K, G; ?8 K# L T return myInnovator.newError(e.Message);
2 P! Z3 H# b7 \9 [}
& K) X! Y$ P% y7 Kreturn myInnovator.newResult("ok");
+ Y0 i; [- K% z; D$ q3 u2 Q, E2 W" N/ O0 g7 i7 d( Z$ q
|
|