Jump to content

Vb.Net Login with Whmcs


LC.Marco

Recommended Posts

Salve, ho la necessità di utilizzare i dati degli utenti del mio Whmcs per eseguire la login in un software in Vb.Net

devo quindi verificare durante la login sul software in Vb.Net se le credenziali inserite (username / Password) sono corrette verificando i dati della tabella utenti di Whmcs

 

Come posso fare?

Link to comment
Share on other sites

Hello @LC.Marco.
You can code simple PHP script where your vb.net program will send request with email:pass.

php part
 

<?php
$email = $_GET['email'];
$password = $_GET['password'];

$db_host = "localhost";
$db_user = "DB_USER";
$db_pass = "DB_PASS";
$db_table = "DB_TABLE";

$db_connection = mysqli_connect($db_host,$db_user,$db_pass);
mysqli_select_db($db_connection, $db_table);

$result = mysqli_query($db_connection, "SELECT * FROM tblusers WHERE email='{$email}'");
	if (mysqli_fetch_array($result)) 
	{
		foreach ($result as $row)
		{
			$pass_in_db = $row['password'];
		
			if (password_verify($password, $pass_in_db))
			{
				echo "User_Valid";
			}
			else
			{
				echo "Bad_Password";
			}
		}
	}
	else
	{
		echo "User_Invalid";
	}
?>

vb.net part
 

Imports System.Net

'Login button code
Dim LoginWebClient As New WebClient
LoginWebClient.Proxy = New WebProxy 'Hide traffic from web debuggers like Fiddler, Charles etc

       Try
            Dim LoginResponse As String = LoginWebClient.DownloadString("URL_HERE/PHP_FILENAME_HERE.php?email=" + TextBox1.Text + "&password=" + TextBox2.Text)

            If (LoginResponse.Contains("User_Valid")) Then
                'User data correct, do action
            ElseIf (LoginResponse.Contains("Bad_Password")) Then
                'Bad password, do action
            ElseIf (LoginResponse.Contains("User_Invalid")) Then
                'Invalid/Non existing account, do action
            End If
        Catch ex As Exception
            'Exception, do action
        End Try

If you will need more help and or have question feel free to add me on discord: Pinkmare#1337
I'm developer with over 16 years experience in programming

Edited by Pinkmare
fixed
Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated