|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique ; g# ?- _+ q( @* n9 @
On the client side use the vault control to write to a text file.
+ v9 _0 F4 z. {' ~JavaScript " T& ^1 d9 x2 D) H, ~
with (top.aras.vault)
[; P, a) `; v. |{ u: \$ {. A/ i5 \" D
fileCreate(filePath); 8 ~1 f+ h3 Y4 H" ?/ \3 j+ h7 ~
fileOpenAppend(filePath);
+ D3 w+ D5 z+ @# n7 ~ fileWriteLine('<AML><Item type="MyItemType"/></AML>');
0 o t" H; w0 ]8 [ g* C fileClose();
. |6 Z/ f) H! k5 X# R/ r}
8 a+ N5 F m( Y. \Technique
2 d( v" B* v! \4 x, S3 e% s0 dOn the server side use the File and StreamWriter namespaces to write to a text file. 1 V: z# X% |( P$ Z. u/ u# k% g# H
C# ) r) E9 Q1 J# X, }. `- @/ @
Innovator myInnovator = this.newInnovator();
2 y" x9 E F* Y ] . Q; F$ o# n4 w% S/ C
// Save the results to a file.
& k2 T0 E. M3 rstring path = myInnovator.MapPath("temp/yoyo.txt");
5 m0 p; Y; G: I4 m% d, utry
! ?4 ^0 i6 }1 u2 Y5 N* \2 I6 [{ ) \/ I* ^& `2 x1 c) \' B8 d
if (File.Exists(path)) File.Delete(path); ! D5 s: W7 | d9 Z j
StreamWriter sw = File.CreateText(path);
/ T% X, K1 e5 R sw.Write(this.dom.InnerXml); " x; h: D* T& Z/ M% ~
sw.Close(); 6 y4 `# s4 J/ h$ `) m
} 6 \5 j' ]% J/ ^, w
caTCh (Exception e) ! j; ^; m2 h+ Y4 _
{ 7 F$ m5 r( L0 O% j, ]
return myInnovator.newError(e.Message); 0 c. m5 M. e8 F8 _
}
|, ?7 Q; e! S- B9 `return myInnovator.newResult("ok"); * I+ ^- T( J+ s: N
- Z8 q) ], U& _1 D9 o
|
|