Writing data into file system is always desired by developers. It is a kind of requirement that can come to any kind of program. I give more importance to writing into file system using my code because I use this way as a debugging method also.
Following code snippet demonstrates a sample file operation:
using System;
using System . IO;
using AGI;
namespace AsteriskGeeks
{
public class Program
{
static void Main ( string [ ] args )
{
MonoTone mono = new MonoTone ();
Keypad key = new Keypad ();
String input = mono . GetData ( "welcome" , 10000 , 1 );
StreamWriter writer = new StreamWriter ( "/var/log/asterisk/Log.txt" , true );
writer . WriteLine ("You have entered number : " + input );
writer . Close ();
mono . HangUp ();
}
}
}