How-to? Connect to remote pc over LAN connection ?
-
plz help me out here dods.., i wanna example a simple one please to connect to other pc in the local area network and perform operation like loging off or killing process that will help me alot ADEL K Khalil
Uh, basically your going to need... 1. A server app for the remote computer 2. A client app for you And that's it. The server will sit on the remote computer listening for for requests on the specified port. This is done with the TcpListener.[^] Then client app will be on your compter and will use the TcpClient class[^] and take the ip address of the server app and the port in the
Connect
method. It's pretty simple. Uh, I think the best way is to look at examples here and on msdn. And, also for the server functions like logging off you can use the API ExitWindowsEx[^]. Uh.... and there are .net classes like Process for killing apps and stuff... yeah.... SO here's the overview. Make the server and the client. Start the server on the remote machine and start it listening for incoming connections. then start your client then say... You have some preconfigurations in your server code that says if the incoming message says "logoff" then your server will run the ExitWindowsEx method. So, with your client enter the name/ip of your remote computer and then send "logoff" to the server then your remote comp. will logoff. there. done. I hope my links work. Remember, theres lots or examples here and msdn. /\ |_ E X E GG -
plz help me out here dods.., i wanna example a simple one please to connect to other pc in the local area network and perform operation like loging off or killing process that will help me alot ADEL K Khalil
RealVNC.COM (free, easy, works).
-
plz help me out here dods.., i wanna example a simple one please to connect to other pc in the local area network and perform operation like loging off or killing process that will help me alot ADEL K Khalil
This easiest way is to use the WSH and vbscript. Here is a quick sample
'strCompName = "." 'This is for the local host strCompName = "computer name" ' ip address may work as well Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strCompName & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'Notepad.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next
Save the code above as stopnotepad.vbs and call it from the commandline with cscript stopnotepad.vbs You may want to check out the MSDN section on scripting, particullarly the scripting clinic and scripting guys. -
Uh, basically your going to need... 1. A server app for the remote computer 2. A client app for you And that's it. The server will sit on the remote computer listening for for requests on the specified port. This is done with the TcpListener.[^] Then client app will be on your compter and will use the TcpClient class[^] and take the ip address of the server app and the port in the
Connect
method. It's pretty simple. Uh, I think the best way is to look at examples here and on msdn. And, also for the server functions like logging off you can use the API ExitWindowsEx[^]. Uh.... and there are .net classes like Process for killing apps and stuff... yeah.... SO here's the overview. Make the server and the client. Start the server on the remote machine and start it listening for incoming connections. then start your client then say... You have some preconfigurations in your server code that says if the incoming message says "logoff" then your server will run the ExitWindowsEx method. So, with your client enter the name/ip of your remote computer and then send "logoff" to the server then your remote comp. will logoff. there. done. I hope my links work. Remember, theres lots or examples here and msdn. /\ |_ E X E GG