Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3457582
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:52:40+00:00 2026-05-18T09:52:40+00:00

Ok, first of all, im a beginer in C# (beginer in programing at all),

  • 0

Ok, first of all, im a beginer in C# (beginer in programing at all), and after a quite search on google, i couldnt find a solution on this one.

So, what i need to do is this:
I have 14 text boxes and a few checkbox’s:

Name, Birth Date, Place of birth and some other information of one person for example… I have one Save button that will save all that information in one .txt or .rtf file. Every time i enter those information’s in textBox’s, it will save it as file named by text entered in textBoxName.

For example:

textBoxName: Petar Milutinovic;
textBoxBirth: 01.11.1991;
textBoxCity: Paracin;

And when i click on Save button, it will save all those information on a file called Petar Milutinovic (same name as textBoxName) in this form:

Name: Petar Milutinovic;
Date of Birth: 01.11.1991;
City: Paracin;

Oh boy… I’m realy sorry for English spelling, its not my main (you noticed that one…). This problem have been quite a pain this days…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:52:41+00:00Added an answer on May 18, 2026 at 9:52 am

    I think the easiest way (since you are a beginner) would be to create a string array that can hold 14 elements since you have 14 textboxes.

    string[] contents = new string[14];
    contents[0] = "Name: " + textBoxName.Text;
    contents[1] = "City: " + textBoxCity.Text;
    contents[2] = "Date of Birth: " + textBoxBirth.Text;
    ...
    

    Then you can save it directly to file with:

    System.IO.File.WriteAllLines(textBoxName.Text + ".txt", contents);
    

    Of course there are other more efficient ways to do this but I think this way is the most understandable.

    (I forgot about your checkboxes, but you can accomplish the same goal with this concept)

    EDIT:

    For checkboxes or radio buttons you can use the Checked (or CheckState) property.

    You could do something like:

    contents[0] = checkBox.Checked ? "1" : "0";
    contents[1] = radioButton.Checked ? "1" : "0";
    

    where 1 represents true and 0 represents false. These values can be anything you like, as long as you read it back correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.