The Consumer Key and Consumer Secret are available on the Connected App Details page.
Setup > App Setup > Create > Apps > Connected Apps: your app > API (Enable OAuth Settings)
Pregunta
I am using .NET Application by passing user(consumer)name I need to retrieve consumer Key and consumer Secret from Salesforce how can I achieve this.
Solución
The Consumer Key and Consumer Secret are available on the Connected App Details page.
Setup > App Setup > Create > Apps > Connected Apps: your app > API (Enable OAuth Settings)
Otros consejos
You need to create a Connected App first. See this help article for instructions on how to create a Connected App. Once that is done, you will be provided with consumer key and secret.