|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
% z) Q* c3 y' L. [On the client side use the vault control to write to a text file.
: s h# X$ {; Z! b+ H5 r0 lJavaScript 3 B! A/ X9 w+ l
with (top.aras.vault)
* v( l) I8 x4 G& i( t, ?& E{
' u+ g N% f' ^& s, w: P7 }5 j fileCreate(filePath); 3 I1 T2 ?" ^* Z& N0 E; }
fileOpenAppend(filePath);
( x2 o1 [& s( B% E fileWriteLine('<AML><Item type="MyItemType"/></AML>');
$ q5 S5 [ l# B" Q+ r6 Z5 e) j fileClose();
) d8 N/ R+ ^& i1 e) J6 N} 0 b& O; d3 B7 b2 j, ^; ?# I9 r4 C1 T9 K
Technique
6 y, J& G) }% B4 P5 T( R; cOn the server side use the File and StreamWriter namespaces to write to a text file.
' r$ K* g. A3 A" Z0 [' aC#
* q9 c) V9 y' w) J4 k' pInnovator myInnovator = this.newInnovator();
, R: z8 z8 f8 Z- m
0 p( n) E' {# w: Q& q// Save the results to a file. ' ?* _: J1 W: y4 _
string path = myInnovator.MapPath("temp/yoyo.txt");
# n6 p# A: M) D$ etry
+ u m3 b! Z& x{
5 J$ k; F; a9 g9 \. l5 q if (File.Exists(path)) File.Delete(path);
% }$ I2 ~7 [+ [: [$ L StreamWriter sw = File.CreateText(path);
- g8 ]# f+ M! X. c- r sw.Write(this.dom.InnerXml);
! }! j3 v, x3 F6 ]2 r, Q( D% i sw.Close(); ; ?3 z; f1 ?2 N, P, B
} ' A: C0 i" j# b$ r7 H! s6 z
caTCh (Exception e)
' V, g1 x- F& v" G{ : G: ?% X* l" j1 i/ u
return myInnovator.newError(e.Message); & c. R' P! k( i& m" a# I
} : \) P* |# @7 {9 Y/ t
return myInnovator.newResult("ok");
; D3 @5 B5 r/ g% S; v
8 ` Q8 R& |* k1 z) R" @( h( p |
|