用vb怎么实现文件的实时监控呢?
例如: 在电脑上删除文件,打开文件,复制文件,粘贴文件,的操做,提示出那个盘下的文件被操作(删除文件操做,打开文件操做,复制文件操做,粘贴文件操做)操做的文件名什么(完整的路径),陈辉老师帮我解决一下,请大家帮忙解决伊下?也可以给我发邮箱[email protected]

解决方案 »

  1.   

    ReadDirectoryChangesW
    这个可以完成你的需要
      

  2.   

    陈辉老师可以给发个代码例子吗?vb有些东西不太熟,发邮箱[email protected]
      

  3.   

    又是要代码的人,有是说对VB不熟悉的人.哎怎么最近这么这样的人~~
    其实你只要不怕累在google里搜索一下,N多实例就出来了
    我之所以在回答问题的时候很少贴出源码,是想让提问者有个过程,有个熟悉掌握的阶段这样下次再遇到这样的情况的时候
    不会又来一次,能够自己独立的解决问题,
      

  4.   

    ReadDirectoryChangesW 在vb里面这个函数怎么用呢?
      

  5.   

     Results 1 - 10 of about 9,960 for ReadDirectoryChangesW vb
      

  6.   

    全局计算机ReadDirectoryChangesW 不如HOOK API 当然新手ReadDirectoryChangesW会容易些
      

  7.   

    谁能告诉我ReadDirectoryChangesW函数怎么用,详细参数,给个代码使用例子?
      

  8.   

    1 详细参数MSDN里面有
    2 网上随便搜搜就有,我找到9,960个网页。
      

  9.   

    楼主连声明API函数都不会,趁早改行吧!!
      

  10.   

    本来想发个实例的,可是现在CSDN竟然控制发的内容的行数了?
    太长了它不让我发!
      

  11.   

    http://groups.google.com.tw/group/microsoft.public.vb.winapi/browse_thread/thread/6580a69b37adfe3c/给你在GOOGLE上搜索了一下,但愿你能看的懂!
      

  12.   

    给你个源代码,自己研究吧。http://www.mndsoft.com/blog/article.asp?id=987
      

  13.   

    我晕,新手直接搞API,简直拿砖头跟鸡蛋去碰!好好打基础吧!
      

  14.   

    api好像就是一个function或者sub吧?连内容都不用自己去写,这么方便的东西为什么说不适合新手呢,建议同志们不要把API看的多么高深多么难吧,那只是MS给我们的一些工具而已。
      

  15.   

    利用微软未开放的api 在shell32中Declare Function SHChangeNotifyRegister()Function SHChangeNotifyRegister Lib "shell32" Alias "#2" _
                                  (ByVal hWnd As Long, _
                                  ByVal uFlags As SHCN_ItemFlags, _
                                  ByVal dwEventID As SHCN_EventIDs, _
                                  ByVal uMsg As Long, _
                                  ByVal cItems As Long, _
                                  lpps As PIDLSTRUCT) As Long' hWnd        - Handle of the window to receive the window message specified in uMsg.' uFlags        - Flag that indicates the meaning of the dwItem1 and dwItem2 members of the
    '                     SHNOTIFYSTRUCT (which is pointed to by the window procedure's wParam
    '                     value when the specifed window message is received). This parameter can
    '                     be one of the SHCN_ItemFlags enum values below.
    '                     This interpretaion may be inaccurate as it appears pdils are almost alway returned
    '                     in the SHNOTIFYSTRUCT. See James' site for more info...' dwEventId - Combination of SHCN_EventIDs enum values that specifies what events the
    '                     specified window will be notified of. See below.
                          
    ' uMsg          - Window message to be used to identify receipt of a shell change notification.
    '                      The message should *not* be a value that lies within the specifed window's
    '                      message range ( i.e. BM_ messages for a button window) or that window may
    '                      not receive all (if not any) notifications sent by the shell!!!' cItems         - Count of PIDLSTRUCT structures in the array pointed to by the lpps param.' lpps             - Pointer to an array of PIDLSTRUCT structures indicating what folder(s) to monitor
    '                      changes in, and whether to watch the specified folder's subfolder.参考偶的http://blog.csdn.net/barenx/archive/2008/03/29/2228845.aspx
    里面详细的源代码,有注释不过是E文
      

  16.   

    在网上搜索“windows未公开API”有这方面的例子
      

  17.   

    监视or监控?
    监视就用ReadDirectoryChangesW吧,监控。。用vc写个驱动也许是个不错的选择