예제 #1
0
 public static string Translate(string text)
 {
     AdmAccessToken admToken;
     string headerValue;
     //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)
     AdmAuthentication admAuth = new AdmAuthentication("bicClient", "WzoZYDtxHMKjrxfXmFy+ML7K18/7nWE+We3SZcs2x+I");
     admToken = admAuth.GetAccessToken();
     // Create a header with the access_token property of the returned token
     headerValue = "Bearer " + admToken.access_token;
     return TranslateMethod(headerValue,text);
 }
예제 #2
0
파일: Translator.cs 프로젝트: ewin66/ciip-1
        public static string Translate(string text)
        {
            AdmAccessToken admToken;
            string         headerValue;
            //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)
            AdmAuthentication admAuth = new AdmAuthentication("bicClient", "WzoZYDtxHMKjrxfXmFy+ML7K18/7nWE+We3SZcs2x+I");

            admToken = admAuth.GetAccessToken();
            // Create a header with the access_token property of the returned token
            headerValue = "Bearer " + admToken.access_token;
            return(TranslateMethod(headerValue, text));
        }