|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 0 O3 W* T9 Y- D; G* N1 w/ L( H
On the client side use the vault control to write to a text file.
; B% w- I9 U D0 |2 h3 S7 NJavaScript & B+ J) B$ _) U+ m% Y
with (top.aras.vault) ' |8 o% w6 J# T7 Z @+ d4 x1 G
{
# n* p; H% n9 I/ }4 Y fileCreate(filePath); N& G* `: o; }
fileOpenAppend(filePath); 3 i( \! q# H! \% b. E d3 S {# k4 b
fileWriteLine('<AML><Item type="MyItemType"/></AML>'); / V; m1 d5 D8 R; O4 b4 f3 c$ P( {* {
fileClose(); Q4 y0 G0 l0 S3 ~" b0 ?! Y
}
$ s- G6 T. A& y# I. x/ s/ d: YTechnique
9 v" D6 o! b$ B. YOn the server side use the File and StreamWriter namespaces to write to a text file. 8 ?2 l: E @8 }' n Q
C# . }( S/ D& T0 m- i
Innovator myInnovator = this.newInnovator(); 3 i/ O( E3 m! q% e8 h
$ }3 H( N6 V' o) l$ e// Save the results to a file. & _; b& W% K% u+ {$ q9 \
string path = myInnovator.MapPath("temp/yoyo.txt"); , a; R' M ?1 i0 E. d5 i6 `
try
, o4 `; b$ V3 l: I7 r8 e{ 1 n0 k7 E3 { H) s2 J
if (File.Exists(path)) File.Delete(path); 5 O3 ?2 b, g5 g- y) Y9 ~/ P
StreamWriter sw = File.CreateText(path);
' g& [1 Y: m/ H2 T# b sw.Write(this.dom.InnerXml); ) y$ r' i5 h/ N
sw.Close(); 7 d+ v0 m, D4 j( l1 t
}
5 H. @0 m, z) Z3 r! k% u+ w4 T1 Z9 e; ncaTCh (Exception e)
5 S5 Z: \3 w4 }: f, M# c1 h{
$ @( t$ d3 x. n2 h5 A return myInnovator.newError(e.Message);
$ A: l& y6 P7 e0 D! ]} ' ?% X1 a6 ~7 j
return myInnovator.newResult("ok"); ' M; x! b% ^1 }# D( [8 s8 D" X" n
2 z) `- v2 S3 B$ ]! b0 U
|
|