|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
7 S' O- W- s3 {; z# J& m: T4 |+ B9 qOn the client side use the vault control to write to a text file. - X6 o( r/ o% X; \6 v
JavaScript
& k8 @) {& L2 F& c( x% ~! Kwith (top.aras.vault) : H' g; k9 t. Z
{ " I; H6 h; J# u6 {) f$ \
fileCreate(filePath);
0 m% A& W2 f% V fileOpenAppend(filePath);
' c) r# B, l3 Q* c9 p7 N. f fileWriteLine('<AML><Item type="MyItemType"/></AML>'); 8 b r6 t7 H9 ^6 C' t
fileClose(); 0 U0 v# k# s8 K/ D; M9 t' v
} + @1 G( F3 W# K' U0 T
Technique
! h D2 y: a, bOn the server side use the File and StreamWriter namespaces to write to a text file. & { R! a. z& D4 I* K: C4 U
C# x g$ ]" w1 g$ n$ T
Innovator myInnovator = this.newInnovator();
$ U0 h7 c( u" C
+ y8 Y) n1 n) C" w3 h V// Save the results to a file. 1 |5 d( K: V0 Q+ w: C" T
string path = myInnovator.MapPath("temp/yoyo.txt");
& V, e# a+ ?+ \5 b& c: i7 P; qtry
" b$ c4 S# x; ~, A+ ?# O7 V{
) B7 v3 S# ^5 ^, R2 M if (File.Exists(path)) File.Delete(path); ! D% e4 J/ w8 v2 i) d* ?
StreamWriter sw = File.CreateText(path); : o. F0 u# }* i) @
sw.Write(this.dom.InnerXml); 3 O N5 E# F% a4 X
sw.Close();
2 c5 m- f/ A' R* K* K0 B}
7 W" q% n, C+ z7 J; z* b( kcaTCh (Exception e) ) W* Y0 C8 V; k
{
0 {, W0 C( p3 j2 G) F; j+ g o2 A return myInnovator.newError(e.Message); 8 z8 }# K M; r1 l g' A
} 3 e5 Z3 @- V$ b" @
return myInnovator.newResult("ok");
. Y# f3 b! G. {" P9 B
0 E" U( q% \2 p! D |
|