如何在C#4.0中为MP3文件构建DirectoryWatcher服务? [英] how to build a DirectoryWatcher service for MP3 files in C# 4.0?

查看:59
本文介绍了如何在C#4.0中为MP3文件构建DirectoryWatcher服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个服务来监控带有子文件夹的文件夹。

onchage我想删除文本文件中的条目(index.txt)

删除我想要从文本文件中删除一行(index.txt)

创建后我想在文本文件中写一个新行(index.text)

i need a service to monitor a folder with subfolders.
onchage i want to remove an entry from text file (index.txt)
on delete i want to delete a row from text file(index.txt)
on created i want to write a new line in text file(index.text)

推荐答案

.Net附带 FileSystemWatcher 类,当目录或目录中的文件发生更改时,侦听文件系统更改通知并引发事件。请参阅文档的链接和示例。
.Net comes with a FileSystemWatcher class that listens to the file system change notifications and raises events when a directory, or file in a directory, changes. See the link for the documentation and an example.


这篇关于如何在C#4.0中为MP3文件构建DirectoryWatcher服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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