hi, can vb6 detect if the unit is connected to a router or have a connection to the net or LAN ? example: if the user is disconnected to the LAN, a msgbox will appear that the unit is not connected, if connected nothing to worry about :) same as an ATM machine, if it has connection the ATM can be used, if not the screen of the machine will be in red and has a msg on it. :) thanks for help !

Recommended Answers

All 11 Replies

I tried this code and it seemed to work.

thanks sir ! i got it ! but my problem now is how the code will run automatically , even im using my program... example: im using my program then accidentally i lost my connection then a msgbox will appear that the connection is lost.

For this type, you need to remove the close button on the form by changing its properties.

then to close the form, you have to place the button on the form and code it as

Private Sub button1_click()
me.hide()
End Sub

By Implementing this, you will make the application similiar to running on background. So if the Internet or Lan Connection ahs changed its state it can pop-up a message box regarding the state of the internet connection.

Hope this helps you...

Have a happie coding...:-D

Or, you could put a timer on the form that runs the same code as command1.
If the connection is lost it pops a msgbox, or changes the color of a shape object in the corner of the form. Use a module boolean variable for up or down and give notice from the Timer1_timer when the state of the connection changes.

Don't worry dear use try this. I hope this is helpful to you.

Private Declare Function InternetGetConnectedState Lib "wininet" (ByRef dwflags As Long, ByVal dwReserved As Long) As Long



Private Sub Timer1_Timer()
 If InternetGetConnectedState(0, 0) = 1 Then
        lblResult.Caption = "Connected"
    Else
        lblResult.Caption = "Not Connected"
    End If
End Sub

enjoy

B FROM MA BACKGRUNG IMAGE LOOCK KASA HOTE HAI K WO KISE B REGULATINO PER BACKGROUNG PIC CHOTE BARI AN HOOO...?

@chaziz,

Aap yaha english par lik karo. ithar logo ko keval English jaantha he...

So please post in English.

@ to everybody....

How can I determined?
► Download speed
► Upload Speed
► Ping

DM Galaxy:
If you have a new question then please post it in a new thread (Article). You are more likely to get an answer to your particular question that way.

@Klahr R:
ok, I have already paste the new thread, But I don't get the single reply... on VB.Net

DM Galaxy:
You might look at this.
and this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.