做过励研superComm二次开发的人进
我现在遇到一个问题。在调用 取文件目录 SCL_GetDirItem  函数的时候出现异常
/// <summary>
         /// 取SCL_DirItemCount针对的路径的文件和子目录项。该函数必须在SCL_DirItemCount后无其他网络操作前调用。一般是先调用SCL_DirItemCount函数获得目录项数,根据目录项数申请缓冲区,然后立即调用SCL_GetDirItem函数取目录保存到刚申请的缓冲区中。
         /// </summary>
         /// <param name="nDevID">设备编号</param>
         /// <param name="ItemCount">项数,一般为SCL_DirItemCount的返回值</param>
         /// <param name="Buff">接收返回的文件和子目录名的空间指针,每个项为32字节,符合FAT16格式的32字节定义,Buff的空间大小必须大于等于ItemCount*32字节。</param>
         /// <returns>取目录成功,返回TRUE(非0),否则返回FALSE(0)</returns>
         [DllImport("SCL_API_Stdcall", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
         public static extern bool SCL_GetDirItem(short nDevID,int ItemCount,ref string Buff);
在调用SCL_DirItemCount是有值。
Buff是需要一个结构来支持
[StructLayout(LayoutKind.Sequential)]
         public struct DirItemType
         {
             [VBFixedArray(8)]
             public char[] Name; // 用空格扩展填充的文件名
             [VBFixedArray(3)]
             public char[] Ext; // 用空格扩展填充的扩展名
             public byte Attr; // 属性,$00表示普通文件, $10表示子目录
             [VBFixedArray(10)]
             public byte[] Reserved; // 保留
             public short CTTime; // 文件创建的时间, bit15-11 时, bit10-5 分, bit4-0 秒/10
             public short CTDate; // 文件创建的日期, bit15-9 年-1980, bit8-5 月, bit4-0 日
             public short Cluster; // 文件存储位置的簇号
             public int Length; // 以字节为单位的文件长度
             public void Initialize()
             {
                 Name = new char[8];
                 Ext = new char[3];
                 Reserved = new byte[10];
             }
         }
------解决方案--------------------
帮顶。给点分
------解决方案--------------------
帮顶一下