Saturday, 7 September 2013

C# Streamreader how to get a color in it

C# Streamreader how to get a color in it

How can i use a color in there:
public void Save(StreamWriter sw) { for (int i = 0; i < liste.Count; i++)
{ Buch b = (Buch)liste[i]; if (i == 0) sw.WriteLine("ISDN ; Autor ; Titel
; Farbe"); sw.WriteLine(b.ISDN + ";" + b.Autor + ";" + b.Titel + ";" +
b.Farbe); } }
public void Load(StreamReader sr)
{
int isdnn;
string autorr;
string titell;
Color col;
sr.ReadLine();
if (sr.ReadLine() != null)
{
string[] teile = sr.ReadLine().Split(';');
try
{
isdnn = Convert.ToInt32(teile[0]);
autorr = teile[2];
titell = teile[3];
string color = teile[4];
col = <---------------------------
}
how can i convert the ,,teile[4]" into a Color?
Would be awesome if someone can help me thanks a lot Ramon

No comments:

Post a Comment