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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:32:31+00:00 2026-06-17T02:32:31+00:00

I am currently programming hangman for learning purposes. For that, I have a text

  • 0

I am currently programming hangman for learning purposes. For that, I have a text file with around 6000 words as an embedded resource. The programm reads the file and takes one random string out of it. Now for added complexity, I made a wordeditor, where you can write your own words. Now my question is: How can I save the edited string array to the resource file?

This code reads the resource file and displays it in a multi-line textbox.

public editorForm()
{
  InitializeComponent();
  string[] Lines = Properties.Resources.wordRes.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
  for (int i = 0; i < Lines.Length; i++)
    {
      textBox1.Text += Lines[i] + Environment.NewLine;               
    }
  textBox1.SelectionStart = textBox1.Text.Length;          
}

And this is my current code for saving, right now its just saving the edited file to the desktop, but I want it to save it as the resource.

private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
  string[] words = textBox1.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
  FileStream overwrite = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\Hangman.txt", FileMode.Create);
  using (StreamWriter file = new StreamWriter(overwrite))
  {
    for (int i = 0; i < words.Length; i++)
    {
      file.Write(words[i] + Environment.NewLine);
    }
  }     
  MessageBox.Show("Words saved. ");
}
  • 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-17T02:32:32+00:00Added an answer on June 17, 2026 at 2:32 am

    The embedded resource is cannot be updated or changed after the assembly has been compiled besides something hacky.

    Why dont you save the data to disk and then when you load it merge the data with the data in the embedded resource. Or just have the file on disk and get of the embedded resource or use embedded resource as default if the file doesnt exist and then write to disk.

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

Sidebar

Related Questions

I'm currently programming a web application that can be embedded. I'm wondering if it
I'm currently learning functional programming in my spare time with Scala, and I have
I'm currently programming an app that deals with line graphs. I have three dots
I am currently learning C++ for a programming course. I noticed that my professor's
I'm currently learning the network programming with C/C++... I have experience .NET but not
I have a question about solving UI freezing. Introduction: I am currently programming an
I am currently learning bash programming and dont really understand why the passing argument
I'm currently programming an app for iphone that uses the tab bar. One of
I am currently programming an ASP .NET FormView. The twist here is that I
I'm currently programming a vocabulary algorithm that checks if a user has typed in

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.