Click here to Skip to main content
16,009,238 members
Home / Discussions / C#
   

C#

 
AnswerRe: Urgent please Pin
Oakman3-May-08 12:13
Oakman3-May-08 12:13 
AnswerRe: Urgent please Pin
Christian Graus3-May-08 12:39
protectorChristian Graus3-May-08 12:39 
AnswerRe: Urgent please Pin
Paul Conrad3-May-08 12:57
professionalPaul Conrad3-May-08 12:57 
QuestionHow to develop virtual environment online using C# with Managed DirectX? (in 3D) Pin
katelva3-May-08 8:23
katelva3-May-08 8:23 
AnswerRe: How to develop virtual environment online using C# with Managed DirectX? (in 3D) Pin
carbon_golem3-May-08 9:46
carbon_golem3-May-08 9:46 
GeneralRe: How to develop virtual environment online using C# with Managed DirectX? (in 3D) Pin
katelva3-May-08 16:29
katelva3-May-08 16:29 
GeneralRe: How to develop virtual environment online using C# with Managed DirectX? (in 3D) Pin
carbon_golem3-May-08 16:37
carbon_golem3-May-08 16:37 
Questionloading a list from a data file Pin
Jerry Graham3-May-08 8:04
Jerry Graham3-May-08 8:04 
I am trying to load data from a data file. At first I declared a list called list<client> clients and I was able to load this list.
Then I tried to declare a class list as shown below and the program crashed on the add statement. Could someone please explain:

namespace WindowsApplication2
{
public struct client
{


public string matter;
public string name;

}
public class clientList
{
public List<client> data;
}

static class Program
{
[STAThread]
static void Main()
{

client Myclient;
clientList clients = new clientList();
FileStream aFile = new FileStream
("TextFile1.txt", FileMode.Open);
StreamReader sr = new StreamReader(aFile);

//load data into the Myclient list
Myclient.matter = sr.ReadLine();
while(Myclient.matter!=null)
{

Myclient.name = sr.ReadLine();
clients.data.Add(Myclient);
Myclient.matter = sr.ReadLine();
}

//

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 f = new Form1();
Application.Run(f);
}

}
}
AnswerRe: loading a list from a data file Pin
Jimmanuel3-May-08 9:34
Jimmanuel3-May-08 9:34 
GeneralRe: loading a list from a data file Pin
Jerry Graham3-May-08 10:12
Jerry Graham3-May-08 10:12 
GeneralRe: loading a list from a data file Pin
Jimmanuel3-May-08 10:44
Jimmanuel3-May-08 10:44 
AnswerRe: loading a list from a data file Pin
carbon_golem3-May-08 9:41
carbon_golem3-May-08 9:41 
GeneralRe: loading a list from a data file Pin
Jerry Graham3-May-08 10:14
Jerry Graham3-May-08 10:14 
GeneralRe: loading a list from a data file Pin
carbon_golem3-May-08 13:32
carbon_golem3-May-08 13:32 
QuestionConverting Double to String Pin
Saba023-May-08 7:44
Saba023-May-08 7:44 
AnswerRe: Converting Double to String Pin
Mohamed El Gohary3-May-08 7:46
Mohamed El Gohary3-May-08 7:46 
AnswerRe: Converting Double to String Pin
Blue_Boy3-May-08 8:21
Blue_Boy3-May-08 8:21 
AnswerRe: Converting Double to String Pin
Luc Pattyn3-May-08 8:51
sitebuilderLuc Pattyn3-May-08 8:51 
AnswerRe: Converting Double to String Pin
Gareth H3-May-08 8:58
Gareth H3-May-08 8:58 
GeneralRe: Converting Double to String Pin
Luc Pattyn3-May-08 10:00
sitebuilderLuc Pattyn3-May-08 10:00 
GeneralRe: Converting Double to String Pin
Gareth H4-May-08 3:34
Gareth H4-May-08 3:34 
GeneralRe: Converting Double to String Pin
Luc Pattyn4-May-08 11:46
sitebuilderLuc Pattyn4-May-08 11:46 
QuestionVisio Control problem in Windows Vista Pin
Kashif Iqbal Khan3-May-08 7:00
Kashif Iqbal Khan3-May-08 7:00 
AnswerRe: Visio Control problem in Windows Vista Pin
Luc Pattyn3-May-08 7:07
sitebuilderLuc Pattyn3-May-08 7:07 
GeneralRe: Visio Control problem in Windows Vista Pin
Kashif Iqbal Khan3-May-08 7:19
Kashif Iqbal Khan3-May-08 7:19 

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.