function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vivek Kashyap 2Vivek Kashyap 2 

SOAP API C# login error INVALID_LOGIN: Invalid username, password, security token; or user locked out.error

While attempting to login C#, Soap API, enterprise wsdl. I am getting INVALID_LOGIN: Invalid username, password, security token; or user locked out.error. I will be grateful for any assistance in resolving this error.
My Code is 
SoapClient loginClient = new SoapClient("Soap");
            string sfdcUserName = "";
            string sfdcPassword = "Password";
            string sfdcToken = "LegAguRb2CzEifnoiPNcVT5UE";
            LoginResult result = loginClient.login(null, sfdcUserName, string.Concat(sfdcPassword,sfdcToken));
            //Read the information
            mSessionId = result.sessionId;
            mServerURL = result.serverUrl;
Daniel BallingerDaniel Ballinger
Are you using Sandbox credentials? If so you would need to alter the endpoint.

Is the user API enabled? You could check this by using the same details with another API based tool.

There is also sample code for calling the login method in