Hi. I am working on my Final for my Intro to C# class so yes I am new and my code is pretty unprofessional probably. We are required to use a array or a class to read addresses from a text file and display them in the GUI. We should be able to add new addresses and delete address and sort the arraylist by Name. Ok Everything works except...the reading and writing to the text file and the sorting. I tried the following to write to the text file which I have in the bin/debug folder of the program. Also I am using Visual Studio 2003 .Net Framework1.1 just in case that helps. ok here is the code I don't get any errors but the file is still blank when I open it.
You have to convert the arraylist element into a string or something before writing it to the file. Just make sure it's in a format that you can read back later.
But guess what? The file is still blank! LOL. Any other ideas that I can try? I know the info is stored in the array I can view it add new ones and delete them. Just don't know why they wont write.
You are writing to "\\AddressList.txt" instead of "AddressList.txt".
Use Write, use WriteLine if you want to start a new line.
Use the using keyword. That way you don't have to bother to close the stream.
If friendName is already a string you don't have to do friendName.ToString()
Oh My God. Just out of curiosity I clicked on the savemenu Item again to see if it goes to that event and guess what. It opened another event. That is so weired since I did the first savemenu Item_click event the same way. Anyhow...It works now....whooo wheeee. Thanks to all of you!
I am Gisha.I am a C# platform programmer.I just want to know the basic steps to create a simple c# application. pls sent me the queries for creation of simple c# application...........
I am Gisha.I am a C# platform programmer.I just want to know the basic steps to create a simple c# application. pls sent me the queries for creation of simple c# application...........
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.