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 7864547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:49:13+00:00 2026-06-02T23:49:13+00:00

I am asking because I am working on a project for school. Yes this

  • 0

I am asking because I am working on a project for school. Yes this is homework. But, I’m trying to understand a little bit more, though.

This is one example of what is being asked.

• When the user clicks the “Save” button, write the selected record to the file specified in txtFilePath (absolute path not relative) without truncating the values currently inside.

This is what I have,

private void button2_Click(object sender, EventArgs e)
{
    if (saveFileDialog1.ShowDialog() == DialogResult.OK)
    {
        StreamWriter myWriter = new StreamWriter(saveFileDialog1.FileName);
        myWriter.Write(txtFilePath.Text);
        myWriter.Close();
    }
}

Now, I don’t understand if I am doing this right. I know when I save it to my desktop and I delete it from my listbox and when I try to reload it again nothing shows up. This is what I have on my form,

private void button1_Click(object sender, EventArgs e)
{
    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {
        StreamReader myReader = new StreamReader(openFileDialog1.FileName);
        txtFilePath.Text = openFileDialog1.FileName;
        txtFilePath.Text = myReader.ReadToEnd();
        myReader.Close();
    }
}    

And this is the load,

private void Form1_Load(object sender, EventArgs e)
{
    string[] myFiles = Directory.GetFiles("C:\\");
    foreach (string filename in myFiles)
    {
        FileInfo file = new FileInfo(filename);
        employeeList.Items.Add(file.Name);
    }

    //...

Can someone please help me make sense of this?

  • 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-06-02T23:49:14+00:00Added an answer on June 2, 2026 at 11:49 pm

    Say you were giving directions to a spot. You have two methods you can describe getting to the location:

    • Relative to where you stand,
    • Relative to a landmark.

    Both get you to the same location, but the former doesn’t always work (“take a left, then a right, go through two lights then take another right” wouldn’t necessarily work from the next town over, but works from where you stand). That’s essentially the difference.

    If you have C:\Windows\System32, that’s an absolute path. If you have Windows\System32, it will only work so long as you’re starting from C:\. If you start in C:\Program Files you would need a ..\ to get there correctly.

    However, no matter where you are on the hard drive, C:\Windows\System32\ is a definitive way to get to that folder.

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

Sidebar

Related Questions

I'm asking this because I'm working with a recursive function that generates a large
This isn't strictly a programming question, but I'm asking it here because it's certainly
I actually feel a little embarrassed asking this because it feels about as basic
I'm asking this because I'm in the process of writing two such editors for
I feel silly asking this because I'm betting the answer is staring right at
Does Spongy Castle Provide the implementation of SHA1PRNG Algorithm? I am asking this because
The reason I'm asking this is because there is a validation in OpenERP that
I'm asking this question, because I can't figure out when I could find an
I'm asking because I'm working on an ASP.NET MVC 1.0 site, thinking of upgrading
I am currently working in a .Net project but from university I have also

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.