0

I want to get the windows shutdown/logoff time by using java.I had tried

Runtime.getRuntime().addShutdownHook(new Message());

I ran this code,I didn't get shutdown time.

4

1 回答 1

3

The JavaDoc is very clear of the method usage.

It says:

Registers a new virtual-machine shutdown hook.

That means the JVM, not the underlying OS.

You should consider C++ or reading the Windows event log for your requirement.

于 2013-10-14T05:09:50.553 回答