在网络资源监控中,如何实现端口扫描,调用Vb中的哪些API函数能实现。具体的完整的实现代码怎么写?多谢。若能实现,第一时间节贴给分!!

解决方案 »

  1.   

    有曾经有过此代码,因为东东太多,无法一时找到,请近期关注,或告知e-mail!
      

  2.   

    http://www.applevb.com/sourcecode/nettools.zip
      

  3.   

    使用winsock控件,然后尝试连接每一个端口:0~65535
      

  4.   

    to mndsoft :
      非常感谢您的热心回复,在下不胜感激。                             xiexie 
                          
                                   2003.4.29
      

  5.   

    监视你的 TCP/IP端口!!!(vb)option explicit
    const portschecked = 200
    private sub command1_click()
    timer1.enabled = true
    timer1.interval = 1000
    end sub
    private sub command2_click()
    timer1.interval = 0
    timer1.enabled = false
    end sub
    private sub timer1_timer()
    dim x as integer
    list1.clear
    for x = 1 to portschecked
    doevents
    text1.text = x
    winsock1.localport = x
    on error resume next
    winsock1.listen  ' if we get an error, the port is busy.
    if err.number = 10048 then
    list1.additem x  ' log active port # to list box.
    err.number = 0
    end if
    winsock1.close
    next x
    end sub
    private sub form_load()
    label1.caption = "checking port #"
    label2.caption = "ports in use"
    command1.caption = "start"
    command2.caption = "end"
    text1.locked = true
    end sub