admin 发表于 2018-8-1 14:06:14

【Aras二次开发源码】如何将文本存成文件

Technique
On the client side use the vault control to write to a text file.
JavaScript
with (top.aras.vault)
{
fileCreate(filePath);
fileOpenAppend(filePath);
fileWriteLine('<AML><Item type="MyItemType"/></AML>');
fileClose();
}
Technique
On the server side use the File and StreamWriter namespaces to write to a text file.
C#
Innovator myInnovator = this.newInnovator();

// Save the results to a file.
string path = myInnovator.MapPath("temp/yoyo.txt");
try
{
if (File.Exists(path)) File.Delete(path);
StreamWriter sw = File.CreateText(path);
sw.Write(this.dom.InnerXml);
sw.Close();
}
catch (Exception e)
{
return myInnovator.newError(e.Message);
}
return myInnovator.newResult("ok");

页: [1]
查看完整版本: 【Aras二次开发源码】如何将文本存成文件