Another way,
GCHandle pinnedArray = GCHandle.Alloc(byteArray, GCHandleType.Pinned);
IntPtr pointer = pinnedArray.AddrOfPinnedObject();
// Do your stuff...
pinnedArray.Free();
More Related Contents:
- Catch multiple exceptions at once?
- How do you do Impersonation in .NET?
- Creating a blocking Queue in .NET?
- What is the difference between String and string in C#?
- Why doesn’t C# infer my generic types?
- How to get the current user in ASP.NET MVC
- Validate image from file in C#
- Is there any benefit of using an Object Initializer?
- How to convert string to double with proper cultureinfo
- Reading excel file using OLEDB Data Provider
- Splitting a string / number every Nth Character / Number?
- How do I create a HashCode in .net (c#) for a string that is safe to store in a database?
- X509Certificate Constructor Exception
- Is it possible to implement smooth scroll in a WPF listview?
- Instantiate an object with a runtime-determined type
- What is the point of Lookup?
- How to read and write ID3 tags to an MP3 in C#? [closed]
- C# SecureString Question
- Shortest way to check for null and assign another value if not
- Passing parameters to XSLT Stylesheet via .NET
- Monitor process start in the system
- copy files with authentication in c#
- Why does StyleCop recommend prefixing method or property calls with “this”?
- .NET (3.5) formats times using dots instead of colons as TimeSeparator for it-IT culture?
- Options for using System.Data.SQLite in a 32bit and 64bit C# world
- Get the exact time for a remote server
- Why does “\n” give a new line on Windows?
- How to lock on an integer in C#?
- How do I determine if a given date is the Nth weekday of the month?
- PostMessage WM_KEYDOWN send multiply keys?