Wednesday, April 30, 2014

Widgets

Get First 55203 ASCII Symbols

Language: Microsoft Visual C#

Hi Friends, today i will tell you code to get First 55,295 ASCIIs symbols stored in your computer. It can be also written in C++. This program even writes (and saves) all the values of ASCII symbols in a Microsoft WordPad file.

        static void Main(string[] args)
        {
            int i = 1;
            List<string> ascii_values = new List<string>();
            Console.WriteLine("How many First ASCII values do you want?");
            int max = Convert.ToInt32(Console.ReadLine());
            DateTime start_time = DateTime.Now;
            while (i <= max) { ascii_values.Add(i + " = " + Char.ConvertFromUtf32(i)); i++; }
            ascii_values.Add("\nTOTAL TIME ELEAPSED: " + (DateTime.Now - start_time).TotalMilliseconds.ToString() + " Milliseconds");
            ascii_values.Add("\nCreated ON: " +DateTime.Now.ToString());
            ascii_values.Add("\nDeveloped By Malwinder Singh");
            ascii_values.Add("\nVisit my Personal Blog: http://www.mssaggoo.blogspot.in");
            File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\First " + max.ToString() + " ASCII Symbols.rtf", ascii_values.ToArray(), System.Text.Encoding.Unicode);
            System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\First " + max.ToString() + " ASCII Symbols.rtf");
        } 


Console Output will be:


Enter value not more than 55203 and press Enter...

Program will stream list of these ASCII symbols to a word pad file which opens automatically and is saved in your desktop.
Output in Word file:


        
                  


No comments:

Post a Comment