Exemplo n.º 1
0
 public TranslatorApi()
 {
     //Get Client Id and Client Secret from https://datamarket.azure.com/developer/applications/
     //Refer obtaining AccessToken (http://msdn.microsoft.com/en-us/library/hh454950.aspx) 
     //admAuth = new AdmAuthentication("clientID", "client secret");
     admAuth = new AdmAuthentication("client20120605test", "CjCgzuvMr9Ajv8OkEw+1EMe31xawr6a90lbeN5I3taI=");
 }
        /// <summary>
        /// συνάρτηση εκκίνησης της διαδικασίας μετάφρασης
        /// </summary>
        public static bool init()
        {
            data = new RegUserPreferences();
            admAuth = new AdmAuthentication("teikavtranslatorZaxVag", "c8NjSbyiJGdZRkY9Iz8vS2K8dpIgxxy94CTpe/ii1Zg=");
            try
            {
                admToken = admAuth.GetAccessToken();
                headerValue = "Bearer " + admToken.access_token;

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return false;
            }
            //GetLanguagesForSpeakMethod();
            return true;
        }