The above solution should be absolutly sufficient for your program. However if you have different machines and cultures involved, use the following:
You can convert a lot of datatypes with Convert. Please make sure you pass a cultureinfo, otherwise it's machine specific and values send from one machine to another might not be convertable by the destination machine if it has different country/culture options. The example uses the current culture, and might break when you involve different cultures. For culture-independent conversion use CultureInfo.InvariantCulure.
<int variable> = Convert.ToInt32(<string value>, CultureInfo.CurrentCulture );