waruna piyadasa

waruna piyadasa

  • 2.1k
  • 10
  • 123

how to do text box characters convert to ascii and multiplication C#

Aug 5 2022 5:09 PM

i have a text "vpn123" in my textbox and i want to convert that all the text in the textbox into ASCII and the ASCII value multiply by 5 and then want to add multiplied values sum add to the next letter ASCII value.I try to do coding but get nothing.Please help!

"vpn123"

v => convert to ASCII * 5 = 590       = 590
p => convert to ASCII * 5 = 560 + 590 = 1150
n => convert to ASCII * 5 = 550 + 1150 = 1700
1 => convert to ASCII * 5 = 245 + 1700 = 1945
2 => convert to ASCII * 5 = 250 + 1945 = 2195
3 => convert to ASCII * 5 = 255 + 2195 = 2450

Need to print '59011501700194521952450' as a output in a massage box

how to do in c# ?


Answers (7)