Guest User

Untitled

a guest
Jun 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment