string转Color
(Color)ColorConverter.ConvertFromString((string)str);//Color转string
((Color)value).ToString();
//string和Brush的转换
Brush color = newSolidColorBrush((Color)ColorConverter.ConvertFromString((string)str));
//Brush转string
((Brush)value).ToString();
//string转byte[]
System.Text.UnicodeEncoding converter = newSystem.Text.UnicodeEncoding();
byte[] stringBytes = converter.GetBytes(inputString);
//byte[]转string
System.Text.UnicodeEncoding converter = newSystem.Text.UnicodeEncoding();
stringoutputString = converter.GetString(stringByte);