示例#1
0
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                Console.WriteLine(HELP_MESSAGE);
                PressAnyKey();
                return;
            }

            if (args[0] == ARG_FROM_STRING)
            {
                if (args.Length < 2 || args[1] == null)
                {
                    Console.WriteLine(HELP_MESSAGE);
                    return;
                }

                string str = args[1];

                TextBlob textBlob = TextBlob.FromString(str, ",");
                Console.WriteLine("ASCII Output\n{0}\n", textBlob.ToBinaryBlob());
            }
            else
            {
                string blob = args[0];

                TextBlob textBlob = new TextBlob(blob);
                Console.WriteLine("ASCII to String (7bit):\n{0}\n\nExtended ASCII to String (8bit):\n{1}\n\n", textBlob.Ascii7Value, textBlob.Ascii8Value);
            }
            PressAnyKey();
        }