daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jun 20th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. csharp> using System.Runtime.InteropServices;  
  2. csharp> BitConverter.GetBytes (32);
  3. { 32, 0, 0, 0 }
  4. csharp> var bytes = BitConverter.GetBytes (32);
  5. csharp> var handle = GCHandle.Alloc (bytes, GCHandleType.Pinned);
  6. csharp> int value;      
  7. csharp> Marshal.PtrToStructure (handle.AddrOfPinnedObject (), value);
  8. csharp> value;
  9. 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top