Created
September 15, 2016 15:17
-
-
Save g4s8/905f6553a523f130a9eb9f0f48091738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var x = new[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; | |
var target = "x"; | |
typeof(string).GetField("m_stringLength", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(target, 16); | |
Console.WriteLine(target); | |
Console.Read(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment