|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique # a) C/ Y' m3 H) F# s8 Y# \/ e
On the client side use the vault control to write to a text file.
+ |5 b. `0 ~! i- ~# dJavaScript : [5 L* p, z/ v) m: c$ A" j
with (top.aras.vault)
6 B k/ X; j L; V{ ; o1 k4 K, e: _. C. F0 |1 k
fileCreate(filePath);
; o3 K2 {! e0 U& J' v fileOpenAppend(filePath);
- Q$ w+ g0 ?$ U1 Y fileWriteLine('<AML><Item type="MyItemType"/></AML>');
& \) p# g- a& e( {' ?: g s2 \2 y fileClose();
! o9 P z2 `! Z+ X: k} & z# c1 t7 z2 ^- D: W+ O& n( r3 \
Technique
; z3 M6 b- Z' u+ P o1 P r8 FOn the server side use the File and StreamWriter namespaces to write to a text file.
, j& F& g* ^- ^7 E( t$ |C#
& I V2 D' s2 y7 j6 b: F) |& ]Innovator myInnovator = this.newInnovator();
& C0 {3 s* g4 W) \, m ?8 ~ ' |" a5 C. ?2 {, q+ B2 X, {, M& }$ A
// Save the results to a file. + `; r. W( s" J7 Y* G$ \
string path = myInnovator.MapPath("temp/yoyo.txt"); $ {6 `( y4 a; Y4 o8 Y1 z% t
try
+ J( f3 i2 z+ e7 J0 L{ 1 j5 x1 m! o' n4 {
if (File.Exists(path)) File.Delete(path); & \% L' v: |4 f. o, ^) E1 y
StreamWriter sw = File.CreateText(path); 8 ^0 h7 O1 O8 g( L! T. b$ H5 A# t
sw.Write(this.dom.InnerXml); 3 n: W! [$ T3 O/ h" V
sw.Close(); C: b! x5 I6 K8 q
} - v; t1 R0 c9 p, ]
caTCh (Exception e) ) C& ]. ~- c2 B8 k9 g! [8 c
{ ( L2 V* U8 p6 m/ `
return myInnovator.newError(e.Message); + ^" D; s3 U9 c) m) U7 L
} - w) [0 o, s' T) Y: w
return myInnovator.newResult("ok");
4 I7 ?" q( V! d* Y0 z& h& U2 l% K2 i# Q- d4 ^" i$ m5 `
|
|