当前位置: 首页 > news >正文

电子商务网站建设pdf做网站的策划方案

电子商务网站建设pdf,做网站的策划方案,网络维护技术,济南建网站哪家好咨询区 PaulB#xff1a;请问在 C# 中如何实现当一个磁盘文件的变更#xff0c;让我的程序马上能感知到#xff1f;回答区 Dirk Vollmar#xff1a;在 C# 中有一个 FileSystemWatcher 类#xff0c;它专门用来做文件的变更感知#xff0c;大概有如下四类通知事件#xf… 咨询区 PaulB请问在 C# 中如何实现当一个磁盘文件的变更让我的程序马上能感知到回答区 Dirk Vollmar在 C# 中有一个 FileSystemWatcher 类它专门用来做文件的变更感知大概有如下四类通知事件Changed文件内容变更通知参考连接http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.changed.aspxCreated文件创建变更通知参考连接http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.created.aspxDeleted文件删除变更通知参考连接https://docs.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher.deleted?redirectedfromMSDNviewnet-5.0Renamed文件重命令通知参考连接http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.renamed.aspx下面的代码就是用来监控 D:\test 目录下的所有 txt 文件。class Program{static void Main(string[] args){CreateFileWatcher(D:\test);Console.ReadLine();}public static void CreateFileWatcher(string path){// Create a new FileSystemWatcher and set its properties.FileSystemWatcher watcher  new FileSystemWatcher();watcher.Path  path;/* Watch for changes in LastAccess and LastWrite times, and the renaming of files or directories. */watcher.NotifyFilter  NotifyFilters.LastAccess | NotifyFilters.LastWrite| NotifyFilters.FileName | NotifyFilters.DirectoryName;// Only watch text files.watcher.Filter  *.txt;// Add event handlers.watcher.Changed  new FileSystemEventHandler(OnChanged);watcher.Created  new FileSystemEventHandler(OnChanged);watcher.Deleted  new FileSystemEventHandler(OnChanged);watcher.Renamed  new RenamedEventHandler(OnRenamed);// Begin watching.watcher.EnableRaisingEvents  true;}// Define the event handlers.private static void OnChanged(object source, FileSystemEventArgs e){// Specify what is done when a file is changed, created, or deleted.Console.WriteLine(File:   e.FullPath     e.ChangeType);}private static void OnRenamed(object source, RenamedEventArgs e){// Specify what is done when a file is renamed.Console.WriteLine(File: {0} renamed to {1}, e.OldFullPath, e.FullPath);}}当然如何你想监控 D:\test 下包括子目录的 txt 文件可以配置 IncludeSubdirectories 属性参考如下代码watcher.IncludeSubdirectories  true;点评区 FileSystemWatcher 非常强大在 .NETCore 中实现对 appsettings 的监控用的就是它作为底层实现。
http://www.yutouwan.com/news/474138/

相关文章:

  • 免费的网站建造网站繁简通
  • 广东品牌网站建设服务机构太原晋民网站建设公司
  • 在国外做盗版网站seo推广目的
  • 规范网站维护 建设 管理wordpress新增站点
  • 怎样自己做网页设计网站手机移动网站建设
  • 英雄联盟网站建设地产网站开发公司
  • 广西南宁官方网站企业企业做企业网站的好处
  • 建网站服务器是什么东西做网站80端口
  • 怎么知道网站用wordpress有专业制作网站的公司吗
  • 找做网站平台公司发债
  • 佛山网站设计讯息互动平台游戏
  • 茂名建设公司网站丹阳是哪里
  • 网站怎么做值班表女生学软件工程很难吗
  • 网站建设氺首选金手指14什么网站教你做美食
  • 交易网站建设需要学什么软件网站建设拟采用的技术路线
  • 网新企业网站管理系统WordPress仿制
  • 网页设计与网站建设分析解析域名就可以做网站
  • 大连网站建设运营百度一下官网搜索引擎
  • 网站的ftp账号和密码是什么一家企业如何建设自己的网站 下载
  • 凤台做网站大连网页设计公司排名
  • 一站式服务平台官网绍兴网站快速排名优化
  • 我想创业做网站服务五象新区开发建设指挥部网站
  • 做网站公司怎么找网站建设前就应该进行网站推广工作
  • 关闭站长工具seo综合查询百度快照搜索引擎
  • 长春站建筑网站服务器和空间大小
  • 服装设计网站有哪些网站代理在线
  • 怎么做网站能快速赚钱温州网站建设wmwl
  • 做网站需要团队还是一个人专业做财经直播网站
  • 珠海网站建易搜互联免费音乐网站建设
  • 保定做网站的公司推广方式图片