Sign in to follow this  
Followers 0
doucment

How to List All Port On Local Machince?

10 posts in this topic

I thought it can be done with "DllCall" ,but I don't Know how to Use it in AutoIt 3.

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
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.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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.

Share this post


Link to post
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 *

Share this post


Link to post
Share on other sites

Thank u a lot!

Share this post


Link to post
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?


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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
Sign in to follow this  
Followers 0