English 中文(简体)
How do i write a txt file using Microsoft Dynamics AX?
原标题:

I want to write a txt file (just like i d do in visual studio with c# using string writer and everything, with which i m already very familiar)

what class and method do i use?

how does it work?

what s the X++ syntax?

最佳回答

You can use the TextIo X++ class or the CLRInterop. Here are 2 X++ jobs to demonstrate both approaches.

static void Job_TextIO(Args _args)
{
    TextIo textIo;
    #File
    ;

    textIo = new TextIo(@"C:	extIOtest.txt", #IO_WRITE);
    textIo.write("Line 1
");
    textIo.write("Line 2");
}


static void Job_StreamWriter(Args _args)
{
    System.IO.StreamWriter sw;
    InteropPermission perm = new InteropPermission(InteropKind::ClrInterop);
    ;

    perm.assert();

    sw = new System.IO.StreamWriter(@"C:	est.txt");
    sw.WriteLine("Line 1");
    sw.WriteLine("Line 2");
    sw.Flush();
    sw.Close();
    sw.Dispose();

    CodeAccessPermission::revertAssert();
}
问题回答

暂无回答




相关问题
Sorting a very large text file in Java

I have a large text file I need to sort in Java. The format is: word [tab] frequency [new line] The algorithm for sorting is: Read some of the file, filtering for purlely alphabetic words. Once you ...

lseek function problem in a copy file program!

Got to use lseek function in this program below... Program is simply copying file (that already exist). I wanned to copy the existing file with the chars from the end of file for example: Sorce_File....

How do i write a txt file using Microsoft Dynamics AX?

I want to write a txt file (just like i d do in visual studio with c# using string writer and everything, with which i m already very familiar) what class and method do i use? how does it work? ...

text file reading in c#

I have a text file, its the content from a mail body.it includes html codes. I want to take only href tags from that text file.I want to do this with asp.net c# web application. Does any one have a ...

libsvm model file format

According to this FAQ the model format in libsvm should be straightforward. And in fact it is, when I call just svm-train. As an example, the first SV for the a1a dataset is 1 3:1 11:1 14:1 19:1 39:...

StreamReader C#

While reading a text file(which contains the location of a file to be exported to a database) using the streamReader function in C#, how can I add a confirmation message to the code that will be ...

Reading a text file and exporting its contents to sql

I m trying to have files(.shp and image file types) that are listed(the location) in a text file exported to a database, by importing it into the manifold program and then exporting them from there ...

热门标签