C#:Console Options and Formatting output(s)
<p>The following tables described the how can you format your console application using console options: </p>
</div>
<div>
Console Options< table border="1" cellspacing="0" cellpadding="0" width="675">
< tr>
< td width="219"> < p align="center"> < strong> Name< /strong> < /p> < /td>
< td width="456"> < p align="center"> < strong> Description< /strong> < /p> < /td>
< /tr>
< tr>
< td width="219"> < p> Read< /p> < /td>
< td width="456"> < p> Reads the character entered by the user< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> ReadLine< /p> < /td>
< td width="456"> < p> Reads the character entered by the user but adds the new line character at the end< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> ReadKey, ReadKey(bool intercepts)< /p> < /td>
< td width="456"> < p> Read the function keys pressed by the user, true (default option) to show the keys on screen otherwise false< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> BackgroundColors< /p> < /td>
< td width="456"> < p> Gets or sets the background color of console< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> ForegroundColor< /p> < /td>
< td width="456"> < p> Gets or sets the foreground color of console< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> ReSetColors< /p> < /td>
< td width="456"> < p> Set the Foreground and Background Console Windows Color to their default< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> BufferHeight< /p> < /td>
< td width="456"> < p> Gets or Sets the height of buffer area< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> BufferWidth< /p> < /td>
< td width="456"> < p> Gets or Sets the width of buffer area< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> SetBufferSize(int width, int height)< /p> < /td>
< td width="456"> < p> Set the height and Width of the screen buffer are.< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> SetCursorPosition(int left, int right)< /p> < /td>
< td width="456"> < p> Sets the cursor position< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> Write< /p> < /td>
< td width="456"> < p> Write the output to the console window< /p> < /td>
< /tr>
< tr>
< td width="219"> < p> WriteLine< /p> < /td>
< td width="456"> < p> Write the output to the console window and adds the newline character at end< /p> < /td>
< /tr>
< /table>
< /div>
< div class="content">
< b> < u> Format output(s)< /u> < /b>
< table border="1" cellspacing="0" cellpadding="0" width="311">
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> < strong> String< /strong> < /p> < /td>
< td width="247" nowrap="nowrap"> < p align="center"> < strong> Descrption< /strong> < /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> C< /p> < /td>
< td width="247"> < p> Output to local currency< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> D< /p> < /td>
< td width="247"> < p> Output to Decimal< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> E< /p> < /td>
< td width="247"> < p> Output to Scientific notations< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> F< /p> < /td>
< td width="247"> < p> Output to fixed point format< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> G< /p> < /td>
< td width="247"> < p> Output to Genera format< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> N< /p> < /td>
< td width="247"> < p> Output to number format, thousand separator with commas(,)< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> P< /p> < /td>
< td width="247"> < p> Output to %age format< /p> < /td>
< /tr>
< tr>
< td width="64" nowrap="nowrap"> < p align="center"> X< /p> < /td>
< td width="247"> < p> Output to Hexadecimal format< /p> < /td>
< /tr>
< /table>
< /div>
Comments
Comments are the lines which are not compiled but useful for programer's reference. C# uses two type of comments just like in C++
Single line Comment:
Eg. //This is single line comment
Multi-line of group comment
Eg. /* This is first line
* This is second line */
For more details, visit http://www.msdotnetheaven.com/ChaptersCsharp/csharplanguagei.htm
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|