winforms - how to convert string number to int and then char? -


i writing program converts string "123124125" integer arrays of length 3 this:

int[0] = 123 int[1] = 124 int[2] = 125 

let's ciphertext string has 123124125.

i used:

int number[100]; int length1 = ciphertext-> length; int count = 0; int count1 = 0; char w[100]; while (count1 < length1) {     number[count] = (ciphertext[count1] * 100) + (ciphertext[count1 + 1] * 10) + ciphertext[count1 + 2];     count++;     count1 = count1 + 3; } 

then wish use formula decrypt , straight convert string of character:

 (int = 0; < sizeof(number); i++)  {      string ^ demessage += convert::tochar(number[i] ^ (int(key) * 2 + int(key) / int(key)) % 255);  } 

but shows following result:

5553195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195195-....................................1849664615

where going wrong? need convert int char first , proceed formula?

thanks. appreciate help.

i c#-developer, syntax might bit incorrect:

try this:

string ^ demessage = ""; (int = 0; < sizeof(number); i++) {     demessage += number[i].tostring("000"); } 

this way every number converted string representation. number[0] value 123 converted string "123" , added demessage.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -