View Full Version : C# and connecting to Vbulletin database
David iZ Mental
10-17-2009, 12:29 AM
I want to make an app, but i have a BIG problem, i want to try and make it so it can connect to my Vbulletin Database and so users can log in and only certain usergroups can do stuff. How do i do this?
I'm kinda a nub at c#
barkermn01
10-18-2009, 12:14 PM
Well this is server side authentication you could do it two ways
The Better but Harder way:
open a socket on port 80 send the http headers and send your data read the return content from that socket and deal with it true false or what ever
The EASY Way
have a WebBrowser that is 0 px width and hight then when a user click the login button, go a to loginscript.php?user={user}&pass={pass}
and have a php script that logs the user in if logied in successfully, output true else output false then your program will wait for WebBrowser to say ready and check if its true or false
oracleguy
10-18-2009, 06:18 PM
Or just connect to the database directly, which I think is what the OP is going for. What database server is the vBulletin database on? MySQL?
The Better but Harder way:
open a socket on port 80 send the http headers and send your data read the return content from that socket and deal with it true false or what ever
FYI, There is a HttpWebRequest class in the System.Net namespace specifically designed for sending HTTP requests and getting data back. No need to manually deal with the HTTP headers and the response.
barkermn01
10-21-2009, 12:32 PM
Or just connect to the database directly, which I think is what the OP is going for. What database server is the vBulletin database on? MySQL?
FYI, There is a HttpWebRequest class in the System.Net namespace specifically designed for sending HTTP requests and getting data back. No need to manually deal with the HTTP headers and the response.
There you go then, But i dont think you can connect to the DB manualy there password encryption is stupid there are full classes in php just to varify a user and his password
oracleguy
10-21-2009, 05:26 PM
There you go then, But i dont think you can connect to the DB manualy there password encryption is stupid there are full classes in php just to varify a user and his password
Sure you can, that is why there are objects for Microsoft SQL Server in the .NET framework and MySQL offers a .NET library to connect to their stuff: http://dev.mysql.com/downloads/connector/net/6.1.html
Both work quite well actually. And there are connectors for other databases. And if there aren't, you can always use ODBC if the database has a driver for that. The .NET framework has generic ODBC objects too.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.