C#使用WIN32API来遍历文件和目录[4]

发表于:2008-04-23来源:作者:点击数: 标签:文件遍历目录
关键字:C# WIN32API#region声明WIN32API函数以及结构************************************** [Serializable, System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Sequential, CharSet=System.Runtime.InteropService
关键字:C# WIN32API    #region 声明WIN32API函数以及结构 ************************************** 
   
   [Serializable, 
   System.Runtime.InteropServices.StructLayout 
   (System.Runtime.InteropServices.LayoutKind.Sequential, 
   CharSet = System.Runtime.InteropServices.CharSet.Auto 
   ), 
   System.Runtime.InteropServices.BestFitMapping(false)] 
   private struct WIN32_FIND_DATA 
   { 
   public int dwFileAttributes; 
   public int ftCreationTime_dwLowDateTime; 
   public int ftCreationTime_dwHighDateTime; 
   public int ftLastAclearcase/" target="_blank" >ccessTime_dwLowDateTime; 
   public int ftLastAccessTime_dwHighDateTime; 
   public int ftLastWriteTime_dwLowDateTime; 
   public int ftLastWriteTime_dwHighDateTime; 
   public int nFileSizeHigh; 
   public int nFileSizeLow; 
   public int dwReserved0; 
   public int dwReserved1; 
   [System.Runtime.InteropServices.MarshalAs 
   (System.Runtime.InteropServices.UnmanagedType.ByValTStr, 
   SizeConst = 260)] 
   public string cFileName; 
   [System.Runtime.InteropServices.MarshalAs 
   (System.Runtime.InteropServices.UnmanagedType.ByValTStr, 
   SizeConst = 14)] 
   public string cAlternateFileName; 
   }  
   

原文转自:http://www.ltesting.net