Way to print/output to file using .NET?

Questions about MultiCharts .NET and user contributed studies.
MeiHua
Posts: 26
Joined: 12 Aug 2012
Has thanked: 1 time

Way to print/output to file using .NET?

Postby MeiHua » 11 Jan 2015

I was wondering if there was a way to output to a file like you can in the powerlanguage version of PRINT. The output methods seem to only be able to print to the console. Is there a way for me to save to an ASCII or txt file instead?

AlphaCat
Posts: 69
Joined: 09 Jul 2013
Been thanked: 9 times

Re: Way to print/output to file using .NET?

Postby AlphaCat » 11 Jan 2015

Maybe not a direct solution to your question, but you might want to consider using real logging framework like nlog. It is in many ways superior to the MC console.

For example you can define multiple logging targets such as file, network, windows event log, database and others. You can have multiple targets and you can even reconfigure targets and log-levels while the signal/indicator is executing without recompiling and reapplying the system to the chart.

Im using nlog and log2console as a logviewer. You can filter log-messages by log-level and class from where the message originated (handy if you have lots of moving parts). I wouldnt want to miss it.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Way to print/output to file using .NET?

Postby Henry MultiСharts » 12 Jan 2015

Hello MeiHua,

Please check StreamWriter Class @ MSDN.


Return to “MultiCharts .NET”