Click here to Skip to main content
15,899,314 members
Home / Discussions / C#
   

C#

 
GeneralRe: Garbage collection problem Pin
Guffa26-Jan-07 6:18
Guffa26-Jan-07 6:18 
GeneralRe: Garbage collection problem Pin
S. Senthil Kumar26-Jan-07 6:45
S. Senthil Kumar26-Jan-07 6:45 
AnswerRe: Garbage collection problem Pin
Judah Gabriel Himango26-Jan-07 5:56
sponsorJudah Gabriel Himango26-Jan-07 5:56 
AnswerRe: Garbage collection problem Pin
Dave Kreskowiak26-Jan-07 6:06
mveDave Kreskowiak26-Jan-07 6:06 
AnswerRe: Garbage collection problem Pin
t4ure4n29-Jan-07 0:13
t4ure4n29-Jan-07 0:13 
QuestionText file handling issue Pin
Andrew Em26-Jan-07 3:21
Andrew Em26-Jan-07 3:21 
AnswerRe: Text file handling issue Pin
Colin Angus Mackay26-Jan-07 3:52
Colin Angus Mackay26-Jan-07 3:52 
AnswerRe: Text file handling issue Pin
bobsugar22226-Jan-07 4:20
bobsugar22226-Jan-07 4:20 
Is there any reason why you have to work with text files? If not I would do something like this:

(There's a bug in the pre tag... it doesn't like generics in examples!)

using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;

[Serializable()]
[XmlRootAttribute("Pack")]
public class Pack
{
private List<string> items;

public Pack()
{
items = new List<string>();
}

public List<string> Items
{
get { return items; }
set { items = value; }
}

public void Load(string filename)
{
XmlSerializer serialiser = new XmlSerializer(typeof(Pack));
Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read);
this.Items = ((Pack)serialiser.Deserialize(stream)).Items;
stream.Close();
}
public void Save(string filename)
{
XmlSerializer serialiser = new XmlSerializer(typeof(Pack));
Stream stream = new FileStream(filename, FileMode.Create, FileAccess.Write);
serialiser.Serialize(stream, this);
stream.Close();
}
}
GeneralAbout the pre tag Pin
Guffa26-Jan-07 8:31
Guffa26-Jan-07 8:31 
GeneralRe: About the pre tag Pin
bobsugar22226-Jan-07 8:59
bobsugar22226-Jan-07 8:59 
GeneralRe: Text file handling issue Pin
Andrew Em28-Jan-07 20:24
Andrew Em28-Jan-07 20:24 
Questionexcel in C# Pin
barak16048726-Jan-07 3:02
barak16048726-Jan-07 3:02 
AnswerRe: excel in C# Pin
Dustin Metzgar26-Jan-07 4:50
Dustin Metzgar26-Jan-07 4:50 
QuestionNeed help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 2:31
csharpguyfromde26-Jan-07 2:31 
AnswerRe: Need help in creating an XML file from a Dataset using a schema file Pin
bobsugar22226-Jan-07 3:12
bobsugar22226-Jan-07 3:12 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 3:16
csharpguyfromde26-Jan-07 3:16 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file [modified] Pin
bobsugar22226-Jan-07 3:41
bobsugar22226-Jan-07 3:41 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 4:42
Abisodun26-Jan-07 4:42 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 5:35
csharpguyfromde26-Jan-07 5:35 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 8:13
Abisodun26-Jan-07 8:13 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 8:37
csharpguyfromde26-Jan-07 8:37 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 9:12
Abisodun26-Jan-07 9:12 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
bobsugar22226-Jan-07 8:32
bobsugar22226-Jan-07 8:32 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 8:35
csharpguyfromde26-Jan-07 8:35 
QuestionAbstract List Pin
jan v p26-Jan-07 2:26
jan v p26-Jan-07 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.