C# NetCDF文件64位读取

[ NetCDF (network Common Data Form)是常用的气象文件压缩格式,网上有开放的库可以进行读取、写入等操作,其文件解析的网站是 netcdf类库下载,支持C++,Fortran,java等语言,使用C#开发,需要DllImport的方式调用C++类库进行开发,开发版本分为32位版和64位版,在引用的时候,32位和64位import的函数不一样,需要进行区别。
这是64位的写法,将较长的size用long方式标示
[DllImport("netcdf.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int nc_open(string path, int mode, long bsize, out int ncidp);

            这是32位的写法
  [DllImport("netcdf.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern int nc_open(string path, int mode, int bsize, out int ncidp);
刚开发的时候,用64位的dll,按照32位的写法,数据一直不能出来,最后,联合调试netcdf的源码才发现此问题,最后能顺利读出来文件。