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

  • Home
  • SEARCH
  • 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 6013605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:34:24+00:00 2026-05-23T02:34:24+00:00

Okay, so I have a text file called Source.txt and it contains code that

  • 0

Okay, so I have a text file called “Source.txt” and it contains code that needs to be read by my program.

I created Source.txt within a folder called “Resources” in my project, I created it, and currently its holding a couple resources.

In Form1, I’m trying to put the text in Source.txt into a string variable, like so:

string s = Properties.Resources.Source;

However, when I do that, it comes up with the error:

does not contain a definition for ‘Source’

How do I fix it?

  • 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-23T02:34:24+00:00Added an answer on May 23, 2026 at 2:34 am

    Chris Lively answered it in the comments:

    You can’t use “.txt” files as resource files. .Net resource files are XML files with a very > particular structure. If you need a resource file, right click on your project name and > click “properties” then go to the Resources tab. Add the strings you need

    Here’s what I did.

    Step 1: Right click my project name, select Properties.

    Step 2: Select the Resources tab in the properties window.

    Step 3: Select the down arrow next to “Add Resource”.

    Step 4: Select “Add New Text File”

    Step 5: Named the text file, added in what I wanted to the text file.

    Its working great, thanks to all who contributed.

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

Sidebar

Related Questions

okay, so i have a text file with example content below line1with some random
Okay, basically, I have a large list of phone numbers in a text file
Say I have a file, myfile.txt. It has a paragraph of text in it,
For a class I have to write a program to read in a text
Okay, so, say I have a text file (not necessarily containing every possible symbol)
Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay I have updated my code quite a bit. I am getting a new
Okay I have updated my code a little, but I am still not exactly
Okay so I have the following Code which appends a string to another in
I have a tab separated text file in the format id | field 1

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.