VB语言

本类阅读TOP10

·Visual Basic 安装程序的制作!!
·一个简单的MP3播放器
·VB中使用EXCEL输出
·VB程序实现WindowsXP效果的界面!!
·VB打造超酷个性化菜单(一)
·VB打造超酷个性化菜单(六)
·透明位图
·平铺与拉伸MDI窗口的背景图 ~!~
·对《VB程序实现WindowsXP效果的界面》一文的补遗
·从Windows资源管理器中拖动文件

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
--------监视你的 TCP/IP端口!!!(vb)-----------

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站


      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 



相关文章

相关软件




月光软件程序下载编程文档电脑教程网站设计网址导航网络文学游戏天地幽默笑话生活休闲写作范文安妮宝贝
电脑技术编程开发网络专区谈天说地情感世界游戏元素分类游戏热门游戏体育运动手机专区业余爱好影视沙龙
音乐天地数码广场教育园地科学大观古今纵横谈股论金人文艺术医学保健动漫图酷二手专区地方风情各行各业

月光软件站·版权所有