The simplest way to test would probably be with a regular expression.
using System.Text.RegularExpressions;
....
// to detect an oct number
Regex.IsMatch(givenString, "[0-7]+");
// to detect a hex number
Regex.IsMatch(givenString, "[0-9A-Fa-f]+");
You can also use Int32.Parse() or Decimal.Parse() to convert a hex
number to a decimal integer.
Joshua Flanagan
http://flimflan.com/blog
How can I test a given string to see if the string is a hex number or an oct
number?