|
-
May 30th, 2007, 06:38 PM
#1
Thread Starter
Addicted Member
[2005] Checking Net Connection, Does vb have a database?,minor question about objects
Ok I have a few questions i'd like to know, if anyone can help me that'd be great
Question 1: How do I check to see if the user has an internet connection?
And basically setup an event so
For a game
They click login, if they're not online, it pops up, with a MessageBox and says "You cannot login without an internet connection"
If they login and are connected, and then during the game, if you disconnect from the internet, it will return you to the main menu,
Can anyone tell me how thats done?
Question 2: Does vb have a built in database? or something?
I've seen a few threads that make it look like it does, if so does anyone know a tutorial (good or bad) for using its database?
And would it be possible to upload that database information to a mysql database? or something?
If it doesn't, what can I use as a database with vb (Microsoft Access?)
Question 3:
I declare my objects / structures like this
Code:
Structure db
Public e As EventArgs 'if I dont have some normal variable, it gives an error saying it hasn't had a variable initilized or something, why is this?
Shared pass(Integer.MaxValue) As String
Shared user(Integer.MaxValue) As String
End Structure
Thanks in advance
Last edited by Icyculyr Fr0st; May 30th, 2007 at 07:08 PM.
-
May 30th, 2007, 08:43 PM
#2
Re: [2005] Checking Net Connection, Does vb have a database?,minor question about objects
Question 1: You can check to see if a user is connected to the Internet by pinging a server or website. Make sure that the server or website you choose does not block ICMP messages. Use a timer to routinely check the Internet connection to verify that the user is still connected.
Question 2: VB does not have its own database. You can use it to connect to and manipulate databases, though. If this is not a commercial product, then you can use an MS Access database, or download a copy of SQL Express (Its Free).
Question 3: I haven't checked this code but John is online and is good at catching errors. So try this:
Code:
Public Structure db
' Use Dim to declare your variables
Dim e As EventArgs
Dim pass(Integer.MaxValue) As String
Dim user(Integer.MaxValue) As String
End Structure
-
May 30th, 2007, 08:49 PM
#3
Re: [2005] Checking Net Connection, Does vb have a database?,minor question about obj
This line:declares a variable. A reference-type variable, i.e. a variable whose type is a class, is NOT an object. That line does not create any object so the variable refers to Nothing. You would have to create an object and assign it to the variable somewhere in your code.
As I said in your other thread, I can't see that structure definition having any place in a well-designed app. It is very suspect.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|