|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
V2 c" }* x4 L) O2 A) VOn the client side use the vault control to write to a text file.
0 @3 X5 e6 S+ }) n2 @6 oJavaScript . W. Y9 F9 e7 ?7 Y
with (top.aras.vault) & N2 {# ^9 a R
{
' h* m) h f8 E2 K fileCreate(filePath);
5 r; L5 I6 X7 w, s fileOpenAppend(filePath); h. h' D+ ~( O0 }0 Y7 ~9 P
fileWriteLine('<AML><Item type="MyItemType"/></AML>');
( R0 R$ N3 t% B; h, _& z( A, P fileClose(); ! g' [! R/ m0 ^. {9 _4 i
}
+ f9 d( q+ N; B5 U) E2 BTechnique
" u: n" \" y8 I. y" ^5 v$ @5 k2 ^( AOn the server side use the File and StreamWriter namespaces to write to a text file.
2 \8 M) n* P$ C8 R' v2 r) g& SC# 5 E" y6 S1 A- p: ~, K
Innovator myInnovator = this.newInnovator();
: m2 r- r1 ]( I + u3 E' f$ ^) \1 [2 T$ S
// Save the results to a file.
$ u2 h: v& ^! `* L# v8 ]. T% C1 ~string path = myInnovator.MapPath("temp/yoyo.txt"); 4 |9 K7 ~1 L2 n9 f; i# @1 A% W
try # p3 \5 A/ N L& ?, A1 Y+ y
{
- j4 l9 R! ~. ^$ J7 | if (File.Exists(path)) File.Delete(path); ; f3 K2 L) a! G: T' ?
StreamWriter sw = File.CreateText(path); 5 r7 |# t1 f6 g! I& y
sw.Write(this.dom.InnerXml);
* f: q' V! [0 D0 u+ B$ A sw.Close();
4 |5 i7 X9 e; ~4 Z8 t}
$ n, e( F2 |& TcaTCh (Exception e) & s% S5 u8 R/ e/ z8 } D, @5 b5 h
{
. z7 d7 b" |2 [( {. O( K' t- V return myInnovator.newError(e.Message); + x4 N5 t1 n4 V7 ~3 m" X6 V
}
- z3 ^# |, R/ l5 qreturn myInnovator.newResult("ok");
/ k# q0 u& i3 H% Y
1 k. k R" S4 k' ?; l9 d/ d) ^ |
|