I need help with this algorythm :
int num = this.UserID * 786;
this.ValidCode = num * 17;
num = this.ValidCode / 12;
this.ValidCode = num + 1991;
I found this code written in vb.net and converted it online to C# as I want to use this for some kind of licensing system.
It wont work because VS tells me i cant calculate with strings or cant convert int to string.
UserID is a string getting from a textbox . I need a way to get it working to work with UserID variable got from textbox1 and textbox 2 should display the final result
string
andint
. Ifthis.UserID
is suitable for anint
, parse it withInt32.Parse
orInt32.TryParse
. And please read FAQ, How to Ask and help center as a start..