There are two ways to access pointers,
Reference Type in 1. C #
2. pointer implementation in C #
Using system; using system. collections. generic; using system. LINQ; using system. text; using system. runtime. interopservices; // <summary> // offline UK operation class /// </Summary> Public unsafe class UK {// reference type variable implementation [dllimport ("UK")] extern static int unikey_find (ref uint handle, ref uint S1, ref uint S2); [dllimport ("UK")] extern static int unikey_logoff (ref uint handle ); // [dllimport ("UK")] // extern static int unikey_log_on_secu (ref uint handle, ref char [] password); [dllimport ("UK")] extern static int unikey_log_on_secu (ref uint handle, char [] password); [dllimport ("UK")] extern static int unikey_log_out_secu (ref uint handle ); [dllimport ("UK")] extern static int unikey_get_com_panfu (ref uint handdle, ref char pdrivename); // pointer address implementation (however, you must set program properties to allow Insecure code) [dllimport ("UK")] extern static int unikey_find (uint * handle, uint * S1, uint * S2); [dllimport ("UK")] extern static int unikey_logoff (uint * handle); [dllimport ("UK")] extern static int unikey_log_on_secu (uint * handle, uint * password); [dllimport ("UK")] extern static int unikey_log_out_secu (uint * handle); [dllimport ("UK")] extern static int unikey_get_com_panfu (uint * handdle, char * pdrivename ); /// <summary> /// search for ukey /// </Summary> /// <returns> </returns> protected static int ukeyfind () {uint handle = 0; uint S1 = 0; uint S2 = 0; int result = unikey_find (ref handle, ref S1, ref S2); return result ;} /// <summary> /// exit ukey /// </Summary> /// <Param name = "handle"> </param> /// <returns> </returns> protected static int ukeylogoff () {uint handle = 0; return unikey_logoff (ref handle );} /// <summary> /// log on to ukey /// </Summary> /// <returns> </returns> protected static int ukeylogonsecu () {uint handle = 0; char [] Password = new char [6] {'1', '2', '3', '4', '5', '6 '}; int result = unikey_log_on_secu (ref handle, password); return result ;} /// <summary> /// exit ukey /// </Summary> /// <returns> </returns> protected static int ukeylogoutsecu () {uint handle = 0; return unikey_log_out_secu (ref handle );}}