|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique ( k; ^9 M- A( G
On the client side use the vault control to write to a text file.
; i% T0 J, L3 j! O. d" T: U$ j* MJavaScript
7 |1 _5 t0 H* T6 Uwith (top.aras.vault) 2 L% e5 v; s+ t. f0 R$ M+ G
{ ) I% |5 F9 k$ T0 H5 H# Y
fileCreate(filePath);
1 L2 m3 S/ H% k/ ], f( _ fileOpenAppend(filePath); 8 l# M' y+ Q2 y( {+ h
fileWriteLine('<AML><Item type="MyItemType"/></AML>'); 5 d& t/ Q& [) b1 e7 o
fileClose(); 1 P; ]6 u- g. j) N7 C$ H; k
} : J0 {! R( t% E$ ~! V: ~2 ?( ?2 E
Technique : M" n* }. f$ W" X; P# S
On the server side use the File and StreamWriter namespaces to write to a text file.
- h; x/ } U2 H U1 g8 G5 _C# , p. J$ z' y" r0 G. ]2 l P$ g9 W3 S
Innovator myInnovator = this.newInnovator(); : }) W/ ^, K' W$ |% _
' b: h- J5 N: f8 |$ S, ]$ g5 w// Save the results to a file.
/ ^. X0 c6 G, [8 A$ W5 Sstring path = myInnovator.MapPath("temp/yoyo.txt");
* }: Y3 [6 w8 Vtry 1 \2 q2 d) u! \- y9 @4 H
{
`; H! e' r, F) E3 h q/ i M+ C if (File.Exists(path)) File.Delete(path); F8 V5 L& O4 A& G4 @ W# b. K! c" p: K
StreamWriter sw = File.CreateText(path); # j" v2 s5 o( Z$ M! {0 L- j# H& _
sw.Write(this.dom.InnerXml);
: Z/ A8 ?/ K8 b3 m" p" _- E) ~ sw.Close(); $ }# d' t5 T* }- S1 ]4 Y
} 5 p" w# D T' x4 R* O5 u. s( ]
caTCh (Exception e)
. W0 A* T* W: K' A$ S{
: A7 a, |2 H# J% [: C return myInnovator.newError(e.Message); X' n% G4 @. l7 u
} , y6 `! G7 M& n
return myInnovator.newResult("ok"); . t \% z7 D f% ~
1 @+ N3 @( P: Y: u
|
|