How to write a collection to a file in C#?
I currently have a winForms program and I'm fairly new to programming.
Right now I have an Item class
public class Item
{
public string @Url { get; set; }
public string Name { get; set; }
public double Price { get; set; }
public int Index { get; set; }
public Item(string @url, string name, double price)
{
this.Url = url;
this.Name = name;
this.Price = price;
}
public override string ToString()
{
return this.Name;
}
}
and throughout the program its stored in a dictionary
Dictionary<int, Item>
How can i create a new file type (.buf) and make it save the dictionary so
it can be opened?
No comments:
Post a Comment