0

How do I write a C# program to check if a port is open in a remote machine from a server?

  • i.e access the server first and then check if a port is open/closed in another machine from there
  • I'm aware of the new TcpClient(hostname, port) command; but do not know how to do that from a server.
Sherry
  • 1
  • 2
  • This is related to http://stackoverflow.com/questions/11837541/check-if-a-port-is-open – George Lica Jul 14 '15 at 10:44
  • Yes .But I have to first login to a server(Machine A) and check the port status of another remote machine (Machine B) . I know how to do it directly for Machine B. – Sherry Jul 14 '15 at 11:09
  • hmm I think not without a program that listens your commands on server side. Think that this can be a very dangerous exploit. the most thing you can do is to use the Ping class but that's not what you need. – George Lica Jul 14 '15 at 11:20
  • I was asked to model it on the PSEXEC.exe – Sherry Jul 14 '15 at 11:27

0 Answers0