Logging in to different domain using LogonUser API

Bhattacharjee, Aditya 0 Reputation points
2024-03-20T09:37:38.5933333+00:00

Calling LogonUser before a Winforms application starts running. So if the credentials are correct the application starts and if they are wrong the application wont start. So this working fine with the user credentials for the domain my system belongs to. I was trying to make this work for a different user in a different domain by entering username in the format domain\username or username@domain. But its not working. Please suggest the right way to implement this.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,609 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.