Loader

Posts 1–6 of 6 · Page 1 of 1
Loader
Hi,
I need help with loader
The loader is in .net visual studio lang.
I need help with connecting to DB.
The db and other things are all right but when i open client it says
MsgBox("Can't connect to database! ", MsgBoxStyle.Critical)

Login.vb
Code:
Imports MySql.Data
Imports MySql.Data.MySqlClient
Public Class Login
    Dim Connected As Boolean
    Dim MysqlConn As MySqlConnection


    Dim server As String = "server=localhost;"
    Dim User As String = "uid=nopenope;"
    Dim Pass As String = "pwd=nope;"
    Dim DB As String = "database=nope;"

    Dim myConnectionString As String

    Function CheckConnection()
        ' Dim Conn As String = "server=" + server + ";userid=" + User + ";password=" + Pass + ";database" + DB
        MysqlConn = New MySql.Data.MySqlClient.MySqlConnection
        MysqlConn.ConnectionString = myConnectionString
        Try
            MysqlConn.Open()
            Status.Text = "Status: Online"
            Connected = True
            MysqlConn.Close()
        Catch ex As Exception
            MsgBox("Can't connect to database! ", MsgBoxStyle.Critical)
            Connected = False
            Status.Text = "Status: Offline"
        Finally
            MysqlConn.Dispose()
        End Try
    End Function
    Private Sub Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        myConnectionString = server _
            & User _
            & Pass _
            & DB

        CheckConnection()
    End Sub
why would you connect to your database directly within your program?
your credentials can easily be stolen that way lol
How would you do that?
I mean how would you do that for it being more secure.
Quote Originally Posted by KingJsi123 View Post
How would you do that?
I mean how would you do that for it being more secure.
your program should connect to your website which has a php script that is protected against sqli attacks that connects to the database and returns a string that your program then evaluates.
K,I still need to fix this xd
Try this line: host=0.0.0.0; port=54445; username=****; password=****; database=loader"
Remember to open NAT
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us