Exemple #1
0
        static void Main(string[] args)
        {
            string credentials = string.Empty;

            try
            {
                credentials = Utility.SimpleGet(
                    Environment.GetEnvironmentVariable("VCAP_URL"),
                    Environment.GetEnvironmentVariable("VCAP_USERNAME"),
                    Environment.GetEnvironmentVariable("VCAP_PASSWORD")).Result;
            }
            catch (Exception e)
            {
                Console.WriteLine(string.Format("Failed to get credentials: {0}", e.Message));
            }

            Task.WaitAll();

            var vcapServices = JObject.Parse(credentials);
            var _url         = vcapServices["text_to_speech"]["url"].Value <string>();
            var _username    = vcapServices["text_to_speech"]["username"].Value <string>();
            var _password    = vcapServices["text_to_speech"]["password"].Value <string>();

            TextToSpeechServiceExample _textToSpeechExample = new TextToSpeechServiceExample(_url, _username, _password);

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string _username = "******";
            string _password = "******";

            TextToSpeechServiceExample _textToSpeechExample = new TextToSpeechServiceExample(_username, _password);

            Console.ReadKey();
        }