|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 8 P% P' B1 y* W* g: F: F- k
On the client side use the vault control to write to a text file.
3 T: L9 l7 ]- _ {3 s% AJavaScript $ ~" `+ C: @$ q& z: A* m' E: E2 m( k
with (top.aras.vault)
" |. @. s2 M) S) d1 Y{
. |) U& B* e2 B1 q+ j. S; B1 Q fileCreate(filePath);
. ~' T8 Z2 l0 M# [; b: @$ K2 {/ G fileOpenAppend(filePath); % J* c! D# N: H1 O6 e- p
fileWriteLine('<AML><Item type="MyItemType"/></AML>'); % w8 P: W# Q0 ]3 Q1 o( V( @: F
fileClose();
' w- k1 J0 D3 V) I( s# }}
, U7 u9 c: q, D: vTechnique
, M+ H3 L! n0 I- VOn the server side use the File and StreamWriter namespaces to write to a text file.
& J0 A9 H6 t- A/ Z+ p5 o0 X8 jC#
, ~3 c/ n5 i$ q& j/ W3 @! eInnovator myInnovator = this.newInnovator();
& R5 [: a! N S ( N5 m! o* V* ^: ^( _
// Save the results to a file. ' H7 E5 ~' x/ _- B) c% n3 V
string path = myInnovator.MapPath("temp/yoyo.txt"); # ]# n$ _3 v G) B; \
try
% z' k# i% Z* E% q; X{ 7 h3 A- Z0 g' K. t# Z+ s. S# d/ d
if (File.Exists(path)) File.Delete(path);
/ T8 c; T: j' v! @2 { U# R StreamWriter sw = File.CreateText(path); ) f; ^. p. {% O* {. r+ @; h* F
sw.Write(this.dom.InnerXml);
2 P- j+ M% A" S2 c sw.Close();
$ S6 p4 o: N; A* x) I% D% O" c" x, J} / Y6 ^" g. r" _- r1 w6 E* Y J8 k
caTCh (Exception e) 3 ]- t2 K) F9 P
{ 4 J% O8 D# R! x6 l
return myInnovator.newError(e.Message); 2 F0 k2 u8 k* G( b, Y
} 2 E& s! L! k0 J# U! m5 v0 I8 ?- _& \# W
return myInnovator.newResult("ok"); 6 q0 o" L- A2 G/ I( W
3 d$ L) c- X" W) { |
|