Last active
February 14, 2018 21:27
-
-
Save paulohenriquesn/4c3348056e6153d5afe0bf822c487d42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
byte[] arraylegal = new byte[128]; | |
void StringToByteArray(string value){ | |
int pointer = 0; | |
byte[] byteToSendtoArray; | |
string[] splitSpace = value.Split(' '); | |
string localMemory = String.Empty; | |
for (int i = 0; i < splitSpace.Length; i++) | |
{ | |
localMemory = splitSpace[i]; | |
splitSpace[i] = "0x" + localMemory; | |
byteToSendtoArray = Encoding.ASCII.GetBytes(splitSpace[i]); | |
for(int a = 0; a < byteToSendtoArray.Length; a++) | |
{ | |
arraylegal[pointer] = byteToSendtoArray[a]; | |
pointer += 1; | |
} | |
Console.WriteLine(splitSpace[i]); | |
pointer += 1; | |
localMemory = String.Empty; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment