Convert() public static method

Convert a number (expressed as a string) from fromBase to toBase
public static Convert ( string number, int fromBase, int toBase ) : string
number string String representation of the number to be converted
fromBase int The current base of the number
toBase int The desired base to convert to
return string
示例#1
0
 public static string FromInt64(long int64)
 {
     BaseConverter.CharList = _charList;
     return(BaseConverter.Convert(number: int64.ToString(CultureInfo.InvariantCulture), fromBase: 10, toBase: 36));
 }
示例#2
0
 public static string FromInt32(int int32)
 {
     BaseConverter.CharList = _charList;
     return(BaseConverter.Convert(int32.ToString(CultureInfo.InvariantCulture), 10, 36));
 }
示例#3
0
 public static string FromGuid(Guid guid)
 {
     BaseConverter.CharList = _charList;
     return(BaseConverter.Convert(guid.ToString("N"), 16, 36));
 }
示例#4
0
 public static string FromHex(string hex)
 {
     BaseConverter.CharList = _charList;
     return(BaseConverter.Convert(hex.ToUpper(), 16, 36));
 }
示例#5
0
 public static string FromGuid(Guid guid)
 {
     return(BaseConverter.Convert(guid.ToString("N"), 16, 36));
 }
示例#6
0
 public static string FromHex(string hex)
 {
     return(BaseConverter.Convert(hex.ToUpper(), 16, 36));
 }