By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

question about string

P: 59
im making a program that basically brute forces a string by converting the first character to its ascii code and then adding one. when the ascii code reaches 126 then the second character will go up one and the first char will start back at 32.then it will convert the ascii codes back to characters and set label 3 to reflect that text.But the problem i have is that when it does it once then each characters index value is decreased by one and the next time it will go up one. IE the firstch starts as the 1st char so its index is 1. but the next time i run the code the firstcharacters index will be 0...i want to know how to fix this easily the code for it is
Expand|Select|Wrap|Line Numbers
  1.   Dim firstch As Integer = Asc(txt.Chars(1))
  2.         Dim secondch As Integer = Asc(txt.Chars(2))
  3.         Dim thirdch As Integer = Asc(txt.Chars(3))
  7.         firstch = firstch + 1
  10.         txt = ChrW(firstch) & ChrW(secondch) & ChrW(thirdch) & "a"
  11.         Label3.Text = txt
Jun 26 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.