void WriteFileText(string, string, bool, string)

Writes text to a file with the option to overwrite or append

Security

Trust Level Required: Full Trust

Parameters

Name Description
filePath string
The path of the file.
text string
The text to write.
append bool
True to append to the end of the file.
characterEncoding (Optional) string
Standard character encoding name to use. Defaults to null.

Remarks

The kiosk user must have sufficient permissions to perform any file IO operation that performs a read or write operation on the current disk.

Examples


var sampleFile = KioApp.DoUrlSubstitution('$$KIO_USERDATA$$') + 'sampleFile.txt';
//a falsy last arg will overwrite any existing text in the file.
KioFileIO.WriteFileText(sampleFile, 'Write this to a file\r\n', 0);
KioFileIO.WriteFileText(sampleFile, 'Append this to the same file', 1); 
    

Requirements

KioWare for Windows version 8.2 or greater.