LC.Marco Posted March 9, 2022 Share Posted March 9, 2022 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? 0 Quote Link to comment Share on other sites More sharing options...
Pinkmare Posted March 10, 2022 Share Posted March 10, 2022 (edited) 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 March 10, 2022 by Pinkmare fixed 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted April 11, 2022 Share Posted April 11, 2022 It’s definitely unique so I give it 👍 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.