|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique : ]: ~8 `# R$ m
On the client side use the vault control to write to a text file.
o! P$ o9 Y( \% Y- K: b4 xJavaScript ; s: |& S7 A1 A# b+ R g' s
with (top.aras.vault)
" H/ M' R3 i( `9 G; Q{ $ [; C0 L0 k0 W' p5 ]
fileCreate(filePath); : a% w5 }! D. Y3 Y; r9 }( k
fileOpenAppend(filePath);
/ d' ] u3 a8 U* T- I% | fileWriteLine('<AML><Item type="MyItemType"/></AML>'); - p8 X8 o9 a( H5 F
fileClose();
/ y6 t7 A( B' Z} - L: x; [+ Q9 x7 Z2 C+ e0 {0 f
Technique
4 p- S( ]' y# KOn the server side use the File and StreamWriter namespaces to write to a text file. & {, v5 `0 {! h; a
C# $ b4 K( \4 W, u
Innovator myInnovator = this.newInnovator();
' @1 l3 |$ j! O. M8 B. g p
: L/ R5 Q {. a// Save the results to a file.
0 D. X* z2 M1 [5 Jstring path = myInnovator.MapPath("temp/yoyo.txt"); 5 h! l$ G7 [, e: L9 Y$ p& j
try , @9 X$ v5 y6 M9 \
{
' \# ~/ k4 ^! p* `/ i if (File.Exists(path)) File.Delete(path); 9 k; ^# B9 p( w9 M0 y2 M2 E
StreamWriter sw = File.CreateText(path); 4 D! n5 F6 {+ \3 X, ?# v/ a
sw.Write(this.dom.InnerXml); $ T5 r' ~: L+ p6 i! f% H9 Y
sw.Close();
1 l5 k! S! B; k1 a# S+ ~ p( r}
- o% x9 }/ h* u6 `1 k8 |caTCh (Exception e)
c) A5 V' P, I9 c6 p{ 9 g& T, K" M6 H9 L
return myInnovator.newError(e.Message); 1 a" v- C: L) `2 @; [& [
}
d+ h: [5 [4 @return myInnovator.newResult("ok");
7 ^! D) E W, r5 ]6 F
$ E( G% d, n- M' |! ?' s1 S |
|