Jump to content

How to List All Port On Local Machince?


Recommended Posts

Why don't you get a DLL monitoring tool, then run Netstat and see what DLLs it calls, then look up the functions in that DLL unti lyou find what you need?

Link to comment
Share on other sites

#include <Constants.au3>

$result = Run(@ComSpec & " /c netstat -n", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

$line = StdoutRead($result)
If @error = -1 Then Exit
MsgBox(0, "netstat", $line)

Agreed, why not use netstat? Just use the above, and if you want to put it in a list view simply use the string function's, (StringSplit(), StringStripCR(), StringStripWS() etc) on the above to extract port's, IP address, status etc.

qq

Link to comment
Share on other sites

Thank u first !

How do i use this script in Windows98?

There is no "netstat.exe" in Win98.

Use "FileInstall ( "source", "dest" [, flag] )"?

What I want is ,that the Port infomation can be got from a DLL .

It's more beautiful and professional.

Link to comment
Share on other sites

Thank u first !

  How do i use this script in Windows98?

  There is no "netstat.exe" in Win98.

  Use "FileInstall ( "source", "dest" [, flag] )"?

check out http://www.sysinternals.com/Utilities/TcpView.html and the command line tool Tcpvcon. Runs also on Win98!

What I want is ,that the Port infomation can be got from a DLL .

It's more beautiful and professional.

Well, then you have to write such a DLL, as it is not just one DLLCall even with the windows API. On the web site mentioned above, they talk about the source code of Netstatp. I guess you can download that source code and make your own DLL from it, provided you have some reasonable knowledge of windows network programming.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

So the entire point of this thread is useless?

@doucment

Wasn't your objective to retrieve IP/Port information like what netstat.exe provides but able to do it with AutoIt? I done the next best thing and provided you will a small script that should work unless, which you pointed out, the machine doesn't netstat.exe on it. And now from your above post it seem's to be that you are going to use the TCPView program that /dev/null gave a link to. Is this true?

qq

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...