Help with TextWriter

  • (2 Pages)
  • +
  • 1
  • 2

26 Replies - 1576 Views - Last Post: 24 February 2016 - 07:17 AM Rate Topic: -----

#1 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Help with TextWriter

Posted 10 February 2016 - 07:12 AM

I am trying to make a program that is a contact book. I need to be able to enter the contact information into (8) different textbox
1. tbsurname 2. tbfirst name 3. tbsuburb 4. postcode 5. address 6. email 7. phone 8. Mobile... the program then has to display the surname and first name in a list box and sort in alphabetical order. All this info of the contacts then has to be saved to a text file and the program needs to be able to read from the text file to retrieve the contacts information (save all the data to text file).. All this was going good until I try to save the text file. I can not get the information to save can one of you programming superstars look at my code and help point me in the right direction. THANK YOU SO MUCH....

namespace Contacts
{

    /// <summary>
    /// This programm will allow the user to add contact detail, that will be saved to a .txt file.
    /// The .txt file will be loaded in a list box when the program is first run and will sort the contact's names in alphabetical
    /// order. There will be buttons that the uses can use to 'Add, Delete  and Save' contacts from the list.
    /// 
    /// Author Shannon Brogden
    /// ID: 130708420
    /// Date: 08-02-2016
    /// </summary>

    public partial class FormContacts : Form
    {
        public FormContacts()
        {
            InitializeComponent();
            DisplayList();
        }

        //Creat a list called _Contacts and sublist Mycontacts
        List<_Contacts> MyContacts = new List<_Contacts>();


        private void btnSave_Click(object sender, EventArgs e)
        {
            SaveText();
        }

        /// <summary>
        /// The Reset method will clear the text in the textbox's, ready for the next input
        /// </summary>

        //reset the textbox so that they are empty of text and ready to input the next contact

        private void Reset()
        {
            tbAddress.Text = "";
            tbEmail.Text = "";
            tbFirstname.Text = "";
            tbMobile.Text = "";
            tbPhone.Text = "";
            tbPostcode.Text = "";
            tbSuburb.Text = "";
            tbSurname.Text = "";
        }

        /// <summary>
        /// The Add button will hold the code that will add a new contact to the list.
        /// This will inclued all the contacts details such as email, address and phone number.
        /// 
        /// </summary>

        private void btnAdd_Click(object sender, EventArgs e)
        {
            //set the value of hasDater to true so that if you get a true outout the contact will be added
            //if bool vaule is false the the if statemt will run

            bool hasData = true;

            _Contacts NewContacts = new _Contacts();
            NewContacts.Surname = tbSurname.Text;
            NewContacts.FirstName = tbFirstname.Text;
            NewContacts.Address = tbAddress.Text;
            NewContacts.Suburb = tbSuburb.Text;
            NewContacts.Postcode = tbPostcode.Text;
            NewContacts.Email = tbEmail.Text;
            NewContacts.Phone = tbPhone.Text;
            NewContacts.Mobile = tbMobile.Text;

            //if statments that will run on a 'false' bool output

            if (String.IsNullOrEmpty(tbSurname.Text))
            {
                MessageBox.Show("Please enter a surname");
                hasData = false;
                return;
            }

            if (String.IsNullOrEmpty(tbFirstname.Text))
            {
                MessageBox.Show("Please enter a firstname");
                hasData = false;
                return;
            }

            if (String.IsNullOrEmpty(tbPhone.Text) && (String.IsNullOrEmpty(tbMobile.Text)))
            {
                MessageBox.Show("Please enter one of the two options (Phone OR Mobile)");
                hasData = false;
                return;
            }

            //This is a bool expresion to check for double up is contact names
            //if the first AND the last name are the same the contact will not be added to the list

            bool duplicateFound = MyContacts.Exists(x => x.FirstName == tbFirstname.Text && x.Surname == tbSurname.Text);

            if (hasData && !duplicateFound)
            {
                MyContacts.Add(NewContacts);
                MyContacts.Sort();
                DisplayList();
                Reset();
            }




        }

        /// <summary>
        /// This is a public class so it can be see by all classes. This method will be call apon to display
        /// the list of names of the contacts in the listbox (lbContacts)
        /// </summary>

        public void DisplayList()
        {
            lbContacts.Items.Clear();
            foreach (var con in MyContacts)
            {
                lbContacts.Items.Add(con.Surname + " " + con.FirstName);
            }
        }

        /// <summary>
        /// A new class called '_Contacts' is created to store the infomation created for the list
        /// and to sort the names in the last that will be displayed in the listbox (lbContacts) later
        /// on in alphabetical order.
        /// </summary>

        // new class that will store the infomation typed into the textbox(s) and create a list of the items
        public class _Contacts : IComparable<_Contacts>
        {
            //the firstname will be added from the texbox and will be stroed in the xml element
            // and the samw will go for the rest of the fields in the class
            [XmlElement("FirstName")]
            public string FirstName
            {
                get;
                set;
            }


            [XmlElement("Surname")]
            public string Surname
            {
                get;
                set;
            }

            [XmlElement("Address")]
            public string Address
            {

                get;
                set;

            }

            [XmlElement("Suburb")]
            public string Suburb
            {
                get;
                set;
            }

            [XmlElement("Postcode")]
            public string Postcode
            {
                get;
                set;
            }

            [XmlElement("Email")]
            public string Email
            {
                get;
                set;
            }

            [XmlElement("Phone")]
            public string Phone
            {
                get;
                set;
            }

            [XmlElement("Mobile")]
            public string Mobile
            {
                get;
                set;
            }

            /// <summary>
            /// The CompareTO method will compair the surnames of each entry and sort them.
            /// </summary>
            
            public int CompareTo(_Contacts other)
            {
                return this.Surname.CompareTo(other.Surname);
            }


        }

        /// <summary>
        /// the net method is the delete method. This code block will Delete a contact from the list
        /// </summary>

            private void btnDelete_Click(object sender, EventArgs e)
            {
            //If statment check to make sure a contact has been selected and IF NOT the show the message
            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a contact to deleat");
            }
            else
            {
                //Find the selected string in the contact list and remove it from the list
                string SelIndex = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(SelIndex);
                MyContacts.RemoveAt(index);
                Reset();
                DisplayList();
            }
        }

        private void lbContacts_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// Listbox method to display all the contact's infomation in the textbox
        /// this block of code saves the contacts infomation in an array clled index and calls
        /// up that array to display the infomation in the textbox's
        /// </summary>

        private void lbContacts_MouseClick(object sender, MouseEventArgs e)
        {
            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("Please select a contact");
            }
            else
            {
                string SelIndex = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(SelIndex);
                lbContacts.SetSelected(index, true);
                tbSurname.Text = MyContacts[index].Surname;
                tbFirstname.Text = MyContacts[index].FirstName;
                tbAddress.Text = MyContacts[index].Address;
                tbSuburb.Text = MyContacts[index].Suburb;
                tbEmail.Text = MyContacts[index].Email;
                tbPhone.Text = MyContacts[index].Phone;
                tbMobile.Text = MyContacts[index].Mobile;
            }

        }


        private void tbPhone_TextChanged(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// In the option of the text box for the phone number and the mobile number I have seleced the "On Key Press" event
        /// and have added the following code to limite the two textboxs to except number only as so the user can not
        /// input letter into the phone number
        /// </summary>
        
        // I have added code into the textbox for the phone number so the that textbox will only except number
        //to try and aid in helping the user from making a misstake and inputting a letter in the phone number

        private void tbPhone_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != '\b')
            {
                e.Handled = !char.IsNumber(e.KeyChar);
            }

        }

        private void tbMobile_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != '\b')
            {
                e.Handled = !char.IsNumber(e.KeyChar);
            }
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            _Contacts UpDateContact = new _Contacts();
            UpDateContact.Surname = tbSurname.Text;
            UpDateContact.FirstName = tbFirstname.Text;
            UpDateContact.Address = tbAddress.Text;
            UpDateContact.Suburb = tbSuburb.Text;
            UpDateContact.Postcode = tbPostcode.Text;
            UpDateContact.Email = tbEmail.Text;
            UpDateContact.Phone = tbPhone.Text;
            UpDateContact.Mobile = tbMobile.Text;

            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("Plese select a contact");
            }

            else
            {
                string SelIndex = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(SelIndex);

                tbSurname.Text = MyContacts[index].Surname;
                tbFirstname.Text = MyContacts[index].FirstName;
                tbAddress.Text = MyContacts[index].Address;
                tbSuburb.Text = MyContacts[index].Suburb;
                tbEmail.Text = MyContacts[index].Email;
                tbPhone.Text = MyContacts[index].Phone;
                tbMobile.Text = MyContacts[index].Mobile;

                Reset();
                DisplayList();
            }
        }

        private void SaveText()
        {
            TextWriter saveText = new StreamWriter("C:\\Users\\Shannon\\Desktop\\AT2-Project.txt");

            string Surname = tbSurname.Text;
            saveText.WriteLine(Surname);
            string Firstname = tbFirstname.Text;
            saveText.WriteLine(Firstname);
            string Address = tbAddress.Text;
            saveText.WriteLine(Address);
            string Postcode = tbPostcode.Text;
            saveText.WriteLine(Postcode);
            string Suburb = tbSuburb.Text;
            saveText.WriteLine(Suburb);
            string Email = tbEmail.Text;
            saveText.WriteLine(Email);
            string Phone = tbPhone.Text;
            saveText.WriteLine(Phone);
            string Mobile = tbMobile.Text;
            saveText.WriteLine(Mobile);

            saveText.Close();
        }
    }
}


   




Is This A Good Question/Topic? 0
  • +

Replies To: Help with TextWriter

#2 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6823
  • View blog
  • Posts: 28,274
  • Joined: 12-December 12

Re: Help with TextWriter

Posted 10 February 2016 - 07:32 AM

What is wrong with your attempt to use the StreamWriter? Are there errors?

You will only be writing the current person's details though. To write them all you could investigate XML Serlialization (you've already indicated steps in this direction with XmlElement).

Examples of XML Serialization
XmlSerializer Class

To get the data back you Deserialize it.
Was This Post Helpful? 0
  • +
  • -

#3 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 10 February 2016 - 07:40 AM

thank you andrewsw,

I have just started doing some reading on the xml serlialization so I will try and work that out and add it in. I was asked to save to a .txt file and I was not sure if the XMLSerlialization will save to a xml file or text file and if it realy matters. I mean just so long as the program works I do not mind. there is no errors it is just when I press the 'SAVE' button nothing is saved to the text file. When I open up the text file it is empty
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6823
  • View blog
  • Posts: 28,274
  • Joined: 12-December 12

Re: Help with TextWriter

Posted 10 February 2016 - 07:48 AM

If you have been asked to save to a .txt file then that is what you should do, but you are best placed to decide what their expectations are. Serialization is a binary, rather than text, format.

In which case, is your SaveText() method ever called? There is a debugging tutorial linked in my signature below; taking this you will be able to set breakpoints and step through your code. A primitive first step is just to display a MessageBox within the method.

If you are simply writing to a text file then you'll need to iterate and write all the contacts' details (and re-construct them in the same way).

XML Serialization and Deserialization is much better for this task, but if the requirement is for simple text writing then that should be your priority.
Was This Post Helpful? 0
  • +
  • -

#5 TheGrovesy   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 56
  • Joined: 17-October 13

Re: Help with TextWriter

Posted 10 February 2016 - 10:37 AM

andrew is right, XML is a much better format to do this sort of Saving/reading to keep its structure.

But also has he says if you have been asked to save specifically in a text file then you must do that and work out your own way of arranging the file in a way that allows you to read it back in.

Either way I assmue you are planning on storing more than one persons information? in which case you also need to consider how you would handle multiple contacts and what happens if a piece of information is missing. Again XML would help with this. Consider the basic example where you only store First name and address. you might have:
John
123 Street
Sarah
234 Lane
Bob
345 road

If one of these lines, for what ever reason, is missing when you read it in from a text file it will be hard to tell this and would probably give strange results in that someones name could appear as an address and all entries after the missing line would be wrong. In xml you could easily flag this a missing and it would not affect all other entries.
Was This Post Helpful? 0
  • +
  • -

#6 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 10 February 2016 - 04:55 PM

Thank you all the help, I have asked and I get it a litte wrong I can use the XML file as well so I am in the process of reading up on how to use the xml serialiation to save the contacts infomation and will see how I get on. thank you all once again I will be back no doubt.
Was This Post Helpful? 0
  • +
  • -

#7 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 11 February 2016 - 05:51 AM

OK I am back haha. And stuck in a big way I have been reading 1000 of forums on XmlSerialization and can not find anything that explains in the slights what I am trying to do. So just to explain I have my code that the have pasted already, what I am trying to do is I have made a windows form that is a contact book of sort. I need to add a contacts information into 8 different textboxs that information than needs to be saved to a xml / txt file. And on reloading the program all saved contacts need to be loaded back from the xml / txt file there is also a list box that will only display first and last name and once clicked on the textbox(s) will be populated with the corresponding contacts information. A little push in the right direction would be great thank you all.
Was This Post Helpful? 0
  • +
  • -

#8 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6823
  • View blog
  • Posts: 28,274
  • Joined: 12-December 12

Re: Help with TextWriter

Posted 11 February 2016 - 06:20 AM

Look at the example, and answer, here:

C# serialize list<string> to xml

What you are doing is the same except, essentially, with List<_Contacts> rather than List<string>. It boils down to serializer.Serialize(stream, list);.

The code in that link also has the Deserialize version.
Was This Post Helpful? 0
  • +
  • -

#9 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 14 February 2016 - 05:20 AM

Sorry all I am back need a little more help. I have been up forever watch 1000 of youtube videos and googling 1000 of forums. But I just can not get my head around the serializing. the program as it it now creates a xml file but no information is saved in the file when I click the 'SAVE' button. I need the xml file to contain the contacts information, so the when the Form is loaded again the xml file is called upon and all the saved contacts are listed in the list box. I just can not for the life of me get the xml file to save the user information.

I get a xml file that look like: <?xml version="1.0" encoding="UTF-16"?>

-<Surname> -<Firstname> -<Address> -<Suburb> -<Postcode> -<Phone>

<Mobile/> </Phone> </Postcode> </Suburb> </Address> </Firstname> </Surname>

with no contact information between the tags.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace ContactList_AT2Project
{
    public partial class Form1 : Form
    {
        public Form1()
        {

            InitializeComponent();
        }

        List<ContactInfo> Contact = new List<ContactInfo>();

        private void button1_Click(object sender, EventArgs e)
        {

            ContactInfo updateInfo = new ContactInfo();
            updateInfo.Surname = tbSurname.Text;
            updateInfo.Firstname = tbFirstname.Text;
            updateInfo.Address = tbAddress.Text;
            updateInfo.Suburb = tbSuburb.Text;
            updateInfo.Postcode = tbPostcode.Text;
            updateInfo.Phone = tbPhone.Text;
            updateInfo.Mobile = tbMobile.Text;

            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("You must select a contact to update");
            }
            else
            {
                string selItem = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(selItem);
                Contact[index].Surname = updateInfo.Surname;
                Contact[index].Firstname = updateInfo.Firstname;
                Contact[index].Address = updateInfo.Address;
                Contact[index].Suburb = updateInfo.Suburb;
                Contact[index].Postcode = updateInfo.Postcode;
                Contact[index].Phone = updateInfo.Phone;
                Contact[index].Mobile = updateInfo.Mobile;
                DisplayContactList();
            }
        }


        private void Reset()
        {
            tbSurname.Text = "";
            tbFirstname.Text = "";
            tbAddress.Text = "";
            tbSuburb.Text = "";
            tbPostcode.Text = "";
            tbPhone.Text = "";
            tbMobile.Text = "";
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("Select a contact to delete");
            }
            else
            {
                string selItem = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(selItem);
                Contact.RemoveAt(index);
                DisplayContactList();
                Reset();

            }

        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            bool hasData = true;

            ContactInfo newContact = new ContactInfo();

            newContact.Surname = tbSurname.Text;
            newContact.Firstname = tbFirstname.Text;
            newContact.Address = tbAddress.Text;
            newContact.Suburb = tbSuburb.Text;
            newContact.Postcode = tbPostcode.Text;
            newContact.Phone = tbPostcode.Text;
            newContact.Mobile = tbMobile.Text;

            if (String.IsNullOrEmpty(tbSurname.Text))
            {
                MessageBox.Show("Enter a surname");
                hasData = false;
                return;
            }
            if (String.IsNullOrEmpty(tbFirstname.Text))
            {
                MessageBox.Show("Enter a firstname");
                hasData = false;
                return;
            }
            if (String.IsNullOrEmpty(tbPhone.Text) && (String.IsNullOrEmpty(tbMobile.Text)))
            {
                MessageBox.Show("You need to enter on contact number");
                hasData = false;
                return;
            }

            bool duplicate = Contact.Exists(x => x.Surname + x.Firstname == tbSurname.Text + tbFirstname.Text);

            if (hasData && !duplicate)
            {
                Contact.Add(newContact);
                SortList();
                Reset();
                DisplayContactList();
            }
            else
            {
                MessageBox.Show("That name exists already");
            }
        }

        public void DisplayContactList()
        {
            lbContacts.Items.Clear();
  
            foreach (var con in Contact)
            {
                lbContacts.Items.Add(con.Surname + ", " + con.Firstname);
            }
        }

        public void SortList()
        {
            
            Contact.Sort();
            DisplayContactList();
        }

        private void lbContacts_MouseClick(object sender, MouseEventArgs e)
        {
            if (lbContacts.SelectedIndex == -1)
            {
                MessageBox.Show("Select a contact name to display information");
            }
            else
            {
                string selItem = lbContacts.SelectedItem.ToString();
                int index = lbContacts.FindString(selItem);
                lbContacts.SetSelected(index, true);
                tbSurname.Text = Contact[index].Surname;
                tbFirstname.Text = Contact[index].Firstname;
                tbAddress.Text = Contact[index].Address;
                tbSuburb.Text = Contact[index].Suburb;
                tbPhone.Text = Contact[index].Phone;
                tbMobile.Text = Contact[index].Mobile;
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            XmlTextWriter XmlContacts = new XmlTextWriter("XmlContacts.xml", Encoding.Unicode);
            XmlContacts.WriteStartDocument();
            XmlContacts.WriteStartElement("Surname");
            XmlContacts.WriteStartElement("Firstname");
            XmlContacts.WriteStartElement("Address");
            XmlContacts.WriteStartElement("Suburb");
            XmlContacts.WriteStartElement("Postcode");
            XmlContacts.WriteStartElement("Phone");
            XmlContacts.WriteStartElement("Mobile");
            XmlContacts.WriteEndElement();
            XmlContacts.WriteEndDocument();
            XmlContacts.Close();
        }
        

        [Serializable()]
        
        public class ContactInfo : IComparable<ContactInfo>
        {


            [System.Xml.Serialization.XmlElement("Surname")]
            public string Surname
            {
                get;
                set;
            }

            [System.Xml.Serialization.XmlElement("Firstname")]
            public string Firstname
            {
                get;
                set;
            }

            [System.Xml.Serialization.XmlElement("Address")]
            public string Address
            {
                get;
                set;
            }

            [XmlElement("Suburb")]
            public string Suburb
            {
                get;
                set;
            }

            [XmlElement("Postcode")]
            public string Postcode
            {
                get;
                set;
            }

            [XmlElement("Phone")]
            public string Phone
            {
                get;
                set;
            }

            [XmlElement("Mobile")]
            public string Mobile
            {
                get;
                set;
            }
            public int CompareTo(ContactInfo other)
            {
                return this.Surname.CompareTo(other.Surname);
            }
        }

        private void lbContacts_SelectedIndexChanged(object sender, EventArgs e)
        {
            SortList(); 
        }
    }
}


 

Was This Post Helpful? 0
  • +
  • -

#10 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7136
  • View blog
  • Posts: 24,244
  • Joined: 05-May 12

Re: Help with TextWriter

Posted 14 February 2016 - 05:51 AM

The problem is that you are using the XmlWriter incorrectly. You not only need to start elements, but you also need to write the data for those elements, and then close the elements.

What happened to your plan to use XML serialization?
Was This Post Helpful? 0
  • +
  • -

#11 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 14 February 2016 - 06:02 AM

thank you for your time Skydiver. I guess I am not quite understanding as I though that add the [Serializable()] at the top of my get,set class made all the public methods Serialized I think I am just missing the context of Serialization I was think that the code might of had to be serialized to convert it into a xml. So I thought I was serializing the code
Was This Post Helpful? 0
  • +
  • -

#12 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7136
  • View blog
  • Posts: 24,244
  • Joined: 05-May 12

Re: Help with TextWriter

Posted 14 February 2016 - 06:10 AM

Did you take time to read post #8?
Was This Post Helpful? 0
  • +
  • -

#13 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 14 February 2016 - 06:24 AM

yeh I did I was just a bit stuck on implementing it into my code and then have a the SAVE button activate the "saving" of the xml file. I will give it another read now and try again as I am more awake this time so it might (I hope) sink in better. thank you once again for your time. I am really enjoying this programming its like a drug it makes me so angry but I can not stop doing it..
Was This Post Helpful? 0
  • +
  • -

#14 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6823
  • View blog
  • Posts: 28,274
  • Joined: 12-December 12

Re: Help with TextWriter

Posted 14 February 2016 - 06:26 AM

Like sex? (Perhaps I've revealed too much ;) )
Was This Post Helpful? 0
  • +
  • -

#15 NewToCode.Text   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-January 16

Re: Help with TextWriter

Posted 14 February 2016 - 07:07 AM

hahah andrewsw... I think I have just found the g spot??!!?? Thank you all I think the big part of the problem was I was trying to write the code all in one big list I added new classed from the 'Project / Add class' tab and had one class with the get; set; code and a new class for the SerializeObjec and Deserialize and I now have a xml file that contains all the names and phone number that I type in when the program is running. Thank you all for you time! now I just have to work on loading the xml file at run time...
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2