Click to See Complete Forum and Search --> : [RESOLVED] help ( detect pc that is on and shutdown it)
d_rev
July 19th, 2008, 04:10 AM
Dear friends, I'm developing internt kiosk program. I'm using vb.net 2008 and windows vista sp1. Is there anyone know the code where we can see which computer that is already turn on?
Example the client is pc 1 until pc 10
and the ip adress of each is 192.168.0.1 until 192.168.0.10
can I know/view which computer that is already turn on from server form?
if can, what is the code?
can anyone help me?
One more thing, Can I shutdown the computer from server?
For example: It's already closing time and if we are turn off computer one by one. It'll takes time and not efficient. So, can I just turn off the client computer from server? If can, can you give me the code?
Thanks for your help.......
satanorz
July 19th, 2008, 05:27 AM
You can ping the host you want to know if up with
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx
If you are using tcp/ip client/server, then after you checked that client is up, you can send a string command like "Shutdown" or similar and when the client receives this, shutdown the pc.
I've read something similar before in
http://www.codeproject.com/KB/vb/RemoteShutdownX.aspx
Hope it helps
sotoasty
July 19th, 2008, 07:19 AM
This might help on the shutdown...
http://www.eggheadcafe.com/tutorials/aspnet/6eebdaf1-a5ce-47dd-a1e5-23e707bbf369/shutdown-restart-or-log.aspx
GremlinSA
July 19th, 2008, 03:51 PM
If you doing the Kiosk software you can implement everything within the app.. You already have the IP linkup, and can use this to check if the client system is still online, and then you can use the ShutDown API call in the client part ..
Gremmy..
dglienna
July 19th, 2008, 05:14 PM
I'd use Terminal Server for the kiosk's. It can connect and run software securely
TT(n)
July 19th, 2008, 06:39 PM
I like dglienna's suggestion for terminal servers.
This works very well, using the API to call the command:
Const SW_SHOWNORMAL As Int32 = 1
Private Declare Function apiWinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Int32) As Int32
apiWinExec("tsshutdn /server:" & RemoteName.Text & " /powerdown", SW_SHOWNORMAL)
All you need to know is the name of the remote computer to shut down.
But I know that there are several ways to do it.
d_rev
July 20th, 2008, 10:58 PM
I like dglienna's suggestion for terminal servers.
This works very well, using the API to call the command:
Const SW_SHOWNORMAL As Int32 = 1
Private Declare Function apiWinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Int32) As Int32
apiWinExec("tsshutdn /server:" & RemoteName.Text & " /powerdown", SW_SHOWNORMAL)
All you need to know is the name of the remote computer to shut down.
But I know that there are several ways to do it.
Do we need to import anything in the vb.net (for example import system.data.oledb when we want to connect to Acsess database)?
Do The Remote Name is the computer Name ?
What about if we use the ip address, is the code will be the same???
TT(n)
July 20th, 2008, 11:21 PM
No
I don't think you'd need an import, if the computer shows up in the task "View workgroup computers", in the "My Network" window.
Yes
If a computer name/s is showing then, you can shut that computer down.
No
Use the computer name with this example.
Other examples suggested may use the ip address, and the port number.
d_rev
July 20th, 2008, 11:48 PM
No
I don't think you'd need an import, if the computer shows up in the task "View workgroup computers", in the "My Network" window.
Yes
If a computer name/s is showing then, you can shut that computer down.
No
Use the computer name with this example.
Other examples suggested may use the ip address, and the port number.
Can you give example with the ip address and port number
Thanks for your help
TT(n)
July 21st, 2008, 02:57 PM
This link has already been posted.
Remote Shutdown (http://www.codeproject.com/KB/vb/RemoteShutdownX.aspx)
Please read the links that members have posted, when they try to answer your question.
dglienna
July 21st, 2008, 05:46 PM
just replace the servername with the server ip address. you don't need to specify a port. i shut down my server that way.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.