如何在vb.net中创建文件系统观察程序 [英] How to create a file system watcher in vb.net

查看:64
本文介绍了如何在vb.net中创建文件系统观察程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中创建文件系统观察程序

How to create a file system watcher in vb.net

推荐答案

www.google .com



做一些研究,在MSDN上有一个可爱的例子,它告诉你文件系统观察者是什么,以及如何使用它。
www.google.com

Do some research, there is a lovely example on the MSDN where it tells you what the file system watcher is, and how to use it.


Imports System.IO

Public Class Blah
    Public Sub New()
        InitializeComponent()

        Dim watcher As New FileSystemWatcher("C:\")
        watcher.EnableRaisingEvents = True

        AddHandler watcher.Changed, AddressOf watcher_Changed
    End Sub

    Private Sub watcher_Changed(ByVal sender As Object, ByVal e As FileSystemEventArgs)
        MsgBox(e.FullPath)
    End Sub
End Class


这篇关于如何在vb.net中创建文件系统观察程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆