color转为brush:
Brush br =
new SolidColorBrush(Color.FromRgb(0,0,0));
string转Color
(Color)ColorConverter.ConvertFromString((
string)str);
//Color转string
((Color) value).ToString();
((Color) value).ToString();
string和Brush的转换
Brush color = newSolidColorBrush((Color)ColorConverter.ConvertFromString((
string)str));
//Brush转string
((Brush) value).ToString();
//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);
byte[] stringBytes = converter.GetBytes(inputString);
//byte[]转string
System.Text.UnicodeEncoding converter = newSystem.Text.UnicodeEncoding();
stringoutputString = converter.GetString(stringByte);