Jump to content

I am fairly new to Visual Studio, and I pretty much have no idea what I'm doing. I need to start a website as part of my code, and I have no idea how to start a website using Basic. I need to start a website after you correctly login.

 

Code:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If TextBox1.Text = "tip23lev" And TextBox2.Text = "0743gcgc" Then
            MsgBox("You are Now Logged In", MsgBoxStyle.Information, "Login")

(I NEED TO START A WEBSITE HERE)(I NEED TO START A WEBSITE HERE)(I NEED TO START A WEBSITE HERE)(I NEED TO START A WEBSITE HERE)
        Else
            If TextBox1.Text = "" And TextBox2.Text = "" Then
                MsgBox("No Username and/or Password Found!", MsgBoxStyle.Critical, "Error")
            Else
                If TextBox1.Text = "" Then
                    MsgBox("No Username Found!", MsgBoxStyle.Critical, "Error")
                Else
                    If TextBox2.Text = "" Then
                        MsgBox("No Password Found!", MsgBoxStyle.Critical, "Error")
                    Else
                        MsgBox("Invalid Username And/Or Password!", MsgBoxStyle.Critical, "Error")

                    End If
                End If
            End If
        End If
    End Sub
End Class
 

Link to comment
https://linustechtips.com/topic/980080-visual-basic-help/
Share on other sites

Link to post
Share on other sites

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If TextBox1.Text = sha256(sanitize(DATABASE.QUERY),SALT) And TextBox2.Text = sha256(sanitize(DATABASE.QUERY),SALT) Then
            MsgBox("You are Now Logged In", MsgBoxStyle.Information, "Login")
            Tools.Shell ".\path\to\server\apache.exe"
        Else
            If TextBox1.Text = "" And TextBox2.Text = "" Then
                MsgBox("No Username and/or Password Found!", MsgBoxStyle.Critical, "Error")
            Else
                If TextBox1.Text = "" Then
                    MsgBox("No Username Found!", MsgBoxStyle.Critical, "Error")
                Else
                    If TextBox2.Text = "" Then
                        MsgBox("No Password Found!", MsgBoxStyle.Critical, "Error")
                    Else
                        MsgBox("Invalid Username And/Or Password!", MsgBoxStyle.Critical, "Error")

                    End If
                End If
            End If
        End If
    End Sub
End Class

There, that should just about do it. :) I'm sure there's a way to actually code / write a web server in VB, but why re-invent the wheel when Apache, NGinx, or Lightspeed webservers already exist? They're going to be more efficient than a webserver written in VB anway so... Oh, also, I added some pseudo-code to your username / password checking - one should NEVER be checking passwords in plaintext, EVER, under any circumstances, as it's a security risk. Instead, your program should be making a sanitized SHA256 (or greater) salted hash check to a backend database using one-way encryption.

 

Unless you means you wanted to open a website, in which case StackOverflow is your friend...

https://stackoverflow.com/questions/6613239/open-a-webpage-in-the-default-browser

Desktop: KiRaShi-Intel-2022 (i5-12600K, 5060 Ti) Mobile: Moto Razr 50 Ultra (Razr+ 2024) | 30GB CAN+US+MEX $30/month
Laptop: Lenovo Yoga 7i (16") 82UF0015US (i7-12700H, 16GB/2TB RAM/SSD, A370M GPU) Tablet: Lenovo Tab Plus (256GB)
Camera: Canon M6 Mark II | Canon Rebel T1i (500D) | Canon SX280 Music: Spotify Premium (CIRCA '08)

Link to comment
https://linustechtips.com/topic/980080-visual-basic-help/#findComment-11828327
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×