需要代码来捕获新创建的文件夹和文件的路径 [英] Need code to capture path of new created folder and file

查看:56
本文介绍了需要代码来捕获新创建的文件夹和文件的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要vb.net中的代码来标识新创建的文件夹或文件的路径.无论如何,可以通过选择新文件夹或从另一个源(磁盘,cd)复制文件来创建文件.
因此,一旦创建了任何文件或文件夹,它都应该抓住它的路径.

谢谢,感谢帮助.

Hi,
i need code in vb.net that will identify path of new created folder or file..creation could anyway, by selecting new folder or copying file from another source (disk,cd).
so as soon as there is creation of any file or folder, it should catch the path of it.

thanks, appreciate help.

推荐答案

使用FileSystemWatcher类.它侦听文件系统更改通知,并在目录或目录中的文件更改时引发事件.此处有更多详细信息:
http://msdn.microsoft.com/en-us/library/system.io. filesystemwatcher.aspx [ ^ ]
Use the FileSystemWatcher class. It listens to the file system change notifications and raises events when a directory, or file in a directory, changes. More details here:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx[^]


这篇关于需要代码来捕获新创建的文件夹和文件的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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