PHP Network
Moderator: General Moderators
PHP Network
Is there a way of outputting information, about a PC when it has been pinged i.e. SHUTDOWN, LOGGEDOFF and so on.
Thank you....
Thank you....
What did you do in java?
What technique did you use to get the information?
Was ist snmp?
If not, what was it?
Please tell me.
Can't help you without you telling me what you've done in java.
Because there is not "the" way to retrieve that information.
It kinda depends on what you have installed on the other pcs, i.e. what is available to collect the information you want.
What technique did you use to get the information?
Was ist snmp?
If not, what was it?
Please tell me.
Can't help you without you telling me what you've done in java.
Because there is not "the" way to retrieve that information.
It kinda depends on what you have installed on the other pcs, i.e. what is available to collect the information you want.
What did you do in java? I used Java Sockets.(Java uses wide range of import functionality, so i utilised the import java.net.*; and
import java.io.*;
Basically i would specfic a port and ip address of the target PC, make a connection. Then if a successful connection was made it would output "user logged on", if there was no connection made because the target PC was off then i would output "PC Switched Off"....
Was ist snmp? I didnt use snmp protocol...
import java.io.*;
Basically i would specfic a port and ip address of the target PC, make a connection. Then if a successful connection was made it would output "user logged on", if there was no connection made because the target PC was off then i would output "PC Switched Off"....
Was ist snmp? I didnt use snmp protocol...
There is no "special" program, on the other machines, as i did not have any java classes on the other machine...
All the the java code did was output successful connections made to the target PC's.. As you dont need a program in the other machine to monitor for incoming socket connections. i didnt program it that way.
If i did it in Java RMI, that would be different.....
All the the java code did was output successful connections made to the target PC's.. As you dont need a program in the other machine to monitor for incoming socket connections. i didnt program it that way.
If i did it in Java RMI, that would be different.....
ghadacr wrote:Basically i would specfic a port and ip address of the target PC, make a connection. Then if a successful connection was made it would output "user logged on", if there was no connection made because the target PC was off then i would output "PC Switched Off"....
Code: Select all
import java.net.Socket;
public class foobar {
public static void main(String[] args) {
// Basically i would specfic a port and ip address of the target PC
try {
// make a connection
Socket socket = new Socket("192.168.0.1", 21);
// Then if a successful connection was made it would output "user logged on"
System.out.println("user logged in");
}
catch(Exception e) {
// if there was no connection made because the target PC was off then i would output "PC Switched Off"....
System.out.println("PC Switched Off");
}
}
}What did you do? Exactly what did you do?
LOL, LOL, LOL
This is how i know you dont know what your doing first you try to give me an anwser trying to use Java, and this is a PHP forum
Second of all the code you gave me, of course it does not work first thing i noticed about your internet example copied code was
Of course its not going to work, if you dont close the comments within the code....
Secondly you have to go into more detail about the specfic port numbers and IP address.....no error ouputting
All i ask for is some direction whether PHP incoprates network capabilties....
This is how i know you dont know what your doing first you try to give me an anwser trying to use Java, and this is a PHP forum
Second of all the code you gave me, of course it does not work first thing i noticed about your internet example copied code was
Code: Select all
catch(Exception e) {
catch(Exception e) {
// if there was no connection made because the target PC was off then i would output "PC Switched Off"....
System.out.println("PC Switched Off");Secondly you have to go into more detail about the specfic port numbers and IP address.....no error ouputting
All i ask for is some direction whether PHP incoprates network capabilties....