|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
/ i. ]: K, j8 c+ d" pOn the client side use the vault control to write to a text file. . T) [0 `! {9 w0 A/ |# i
JavaScript
9 o" m- X2 @: ]5 t+ qwith (top.aras.vault) 3 k$ s/ @# e* W: z, c
{
! z: o6 P6 X0 k) O$ z d* a( } fileCreate(filePath); " O, u) c. G0 X/ C8 K( |- ?
fileOpenAppend(filePath); 5 t0 [( [4 s2 G0 d; t k9 B* f6 C
fileWriteLine('<AML><Item type="MyItemType"/></AML>');
, c5 I1 G3 p/ f% C6 f$ k0 ? fileClose(); ( t' H8 h: M4 F- A0 s9 g$ Z
}
) T% r" A1 {3 W; w8 Z) `/ q" }Technique
! C& D6 f% y- I& {# }On the server side use the File and StreamWriter namespaces to write to a text file. & b8 _* l: l8 J. `+ h
C# 9 D E/ P: R& @% U
Innovator myInnovator = this.newInnovator();
. ]' _) q! Y# l N# I + w& X- e5 z" x9 U D
// Save the results to a file.
& e7 P8 ~1 Y4 T2 {1 K, X) _ O$ W' cstring path = myInnovator.MapPath("temp/yoyo.txt");
* R- @6 @ x0 l' ltry
& `0 K( l+ s6 k1 F! g{
! a6 a+ d: c7 H' z T* Q* Q$ k if (File.Exists(path)) File.Delete(path);
! t' E* V4 P0 _) y+ v5 f StreamWriter sw = File.CreateText(path);
. h. @: q, u! Q6 [0 a' r6 K' X sw.Write(this.dom.InnerXml); ) v) Q( @/ X# u% @
sw.Close();
5 i4 x- Z$ \' U} / d/ L& q& {+ D# ?8 Z6 h. T, O
caTCh (Exception e)
; S( H! k. Z+ R0 J* b4 |{
0 n E" \$ D8 A; V( A return myInnovator.newError(e.Message);
w& C: p$ b8 ~3 p& C/ } X}
, t, `* i; C3 Z& ?return myInnovator.newResult("ok"); ' j% n" m$ M9 Q
( v: \7 a! x Y# D% A
|
|