|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique ' ]' ]/ A K$ h8 S* o. N
On the client side use the vault control to write to a text file. / b; V4 ^: X) j% s/ k' C
JavaScript
) `1 N x$ p& |- d$ {with (top.aras.vault) 9 w3 x# l5 Q) F7 Z2 Z. |- w
{
+ h Y' [' G% T! e0 } fileCreate(filePath);
0 E' s, D: e4 \+ L( l fileOpenAppend(filePath); 8 i% i7 k: \& i
fileWriteLine('<AML><Item type="MyItemType"/></AML>');
/ c6 {: V3 E! Z! t" L6 J% \ fileClose(); 2 o2 I. e- |3 i6 y" P5 y
}
" v/ U0 G/ v9 l# gTechnique
9 z7 B4 F+ U7 F3 cOn the server side use the File and StreamWriter namespaces to write to a text file.
7 j8 |: X5 c$ V7 L3 e* N; U. AC# : D4 w1 p0 v8 H7 r
Innovator myInnovator = this.newInnovator();
4 Y6 v, d6 R8 Z: D3 U( O0 _# T
" p3 Z" s3 y- z) N1 v1 _// Save the results to a file.
4 B: Y6 |1 r) Q5 M8 F( J2 f, nstring path = myInnovator.MapPath("temp/yoyo.txt"); , k' ^( ]. U6 `, i9 Z2 ^
try . Z' |6 L* X) L e- w
{ + Z8 y) b' ^1 h1 g$ ~6 W8 K$ S/ m
if (File.Exists(path)) File.Delete(path); , R* ?; W0 f0 a4 x% S
StreamWriter sw = File.CreateText(path);
( l6 N7 t$ u6 w* V. f2 u+ ? sw.Write(this.dom.InnerXml); / L( l( f* g. T
sw.Close(); 8 I. W+ V: N- D3 ~3 A! e0 j
}
# H3 L2 |1 a4 e- P& FcaTCh (Exception e)
( @- d: p& _) t3 R9 T5 e{ 3 {. L# q. W1 j, _2 a
return myInnovator.newError(e.Message);
+ x% m& p+ T6 T# E5 G( S}
4 T5 ~) n! A5 c0 ^/ }6 i E- z9 Vreturn myInnovator.newResult("ok");
8 m1 {" q. S7 B+ V2 _6 ^2 D- u! J* g! J# b
|
|