[NetCDF (Network Common Data Form) is a commonly used weather file compression format, online open libraries can be read, write, and other operations, its file resolution of the site is NetCDF class library download, support C++,fortran,java and other languages, using C # Development, need DllImport way call C + + class library development, development version is divided into 32-bit version and 64-bit version, at the time of reference, the function of 32-bit and 64-bit import is different, need to differentiate.
This is the 64-bit notation, the longer size is indicated by a long way
[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的源码才发现此问题,最后能顺利读出来文件。
C # netcdf file 64-bit read