Guest User

Untitled

a guest
Jul 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6.  
  7. namespace TestBox
  8. {
  9.  
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. Guid result = Guid.NewGuid();
  15.  
  16. IntPtr newIntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(result));
  17.  
  18. Marshal.StructureToPtr(result, newIntPtr, true);
  19.  
  20. Console.WriteLine(result);
  21. Console.WriteLine(newIntPtr);
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment