static void Main(string[] args) { 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("client_id", "client_secret"); try { admToken = admAuth.GetAccessToken(); // Create a header with the access_token property of the returned token headerValue = "Bearer " + admToken.access_token; DetectMethod(headerValue); } catch (WebException e) { ProcessWebException(e); Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } }
static void Main(string[] args) { 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("client_id", "client_secret"); try { admToken = admAuth.GetAccessToken(); // Create a header with the access_token property of the returned token headerValue = "Bearer " + admToken.access_token; DetectMethod(headerValue); } catch (WebException e) { ProcessWebException(e); Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine("Press any key to continue..."); Console.ReadKey(true); } }