How do I get a program to check to see if the computer is shuting down or logging off?
I want to run code when the computer is shutting down.

Recommended Answers

All 2 Replies

>check to see if the computer is shuting down or logging off?

Ping.

>check to see if the computer is shuting down or logging off?

Ping.

Do you mean like this?

If My.Computer.Network.Ping(userip) Then
            MsgBox("computer is shutting down")
        Else
            MsgBox("Computer is working")
        End If
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.