Forum Discussion

Hafedh_Elfaleh's avatar
Hafedh_Elfaleh
Ideator III
6 years ago

write data into an external file in HDD

Hello All ,
how to write data into an external file in HDD programmatically using aras?
not using aras 'CCO.Utilities.WriteDebug(filename,msg)".

Thanks
Best Regards.
Hafedh.

1 Reply

  • Suhas's avatar
    Suhas
    Creator III

    Hello Hafedh_Elfaleh,

    Which kind of file you want to write e.g .xls,xml for simple txt file

    Based on file type your code will be differ.

    You can write file writing code in your aras method.

    Below is the sample code to write a txt file.

    StringBuilder csv = new StringBuilder();
    csv.Append("Sample data");

    //file path(string): where you want to save this file physically
    string filePath=@"D:\SupplimentLabLoc\abc.txt";
    File.WriteAllText(filePath, csv.ToString());

    Regards,

    Suhas