|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
" J. Q8 w8 @4 x; VOn the client side use the vault control to write to a text file. $ e& P( D, o5 A; S
JavaScript / d+ }3 Y9 ~* E- y8 x% I) F! N
with (top.aras.vault) * g- i. K+ n, I6 S+ V( X
{
' H6 \; o; K% W8 { fileCreate(filePath);
+ y9 v! Y _# |$ g fileOpenAppend(filePath);
0 {% O* T3 ^6 r fileWriteLine('<AML><Item type="MyItemType"/></AML>');
+ Q1 w$ l6 `# f# o2 L. q' M9 K; \ fileClose();
4 c5 L( E1 g- ?: ^. h} ; `/ X- J+ g8 H3 L3 U$ u
Technique
) j/ q% g G @' c7 `& a6 pOn the server side use the File and StreamWriter namespaces to write to a text file. . d1 w: d" x, O7 I
C#
% o; W% x* A- n) R: C, ZInnovator myInnovator = this.newInnovator();
% g& ]! R, Z( ]0 k 3 ^9 K, |, e9 t
// Save the results to a file.
$ m+ ^; d0 T: g) E0 Istring path = myInnovator.MapPath("temp/yoyo.txt");
. `/ b5 |* l6 B+ K9 Htry + U. o# P7 t- F/ @6 V5 `+ @
{ / g9 n p: d! a- a
if (File.Exists(path)) File.Delete(path);
: d$ q$ G0 y# s, _" \0 z3 N StreamWriter sw = File.CreateText(path);
6 v# I3 h4 k; Y$ m/ O( _. ` sw.Write(this.dom.InnerXml);
8 f2 `( n S3 q; j# H& b sw.Close(); 9 V) V! k* p' J8 g6 v& H; c
}
" i$ `8 K' a& ^/ M% m8 i$ M! l& KcaTCh (Exception e)
1 i" Z. i P2 M5 w{ 7 k- K! u1 z- V. k6 D
return myInnovator.newError(e.Message); & ?; E0 @6 @, L4 H8 N
} & h( b. }6 }; I- e" V! j7 z: n
return myInnovator.newResult("ok");
$ c" P: {. O* r0 G
n/ T6 C- u% k- b0 G |
|