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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:19:24+00:00 2026-06-10T03:19:24+00:00

Are there any guides for saving data from a C# application to its own

  • 0

Are there any guides for saving data from a C# application to its own external project file such as embedding images, etc. to be loaded later? Thanks.

  • 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-10T03:19:26+00:00Added an answer on June 10, 2026 at 3:19 am

    You can embed just about any type of data in a .NET assembly and read from it, but you cannot modify your own executable(s), and even if you could, that would be a bad idea. For one, think about how trippy that would be for an antivirus program seeing an EXE suddenly change while running.

    If you have metadata (images or any other type of file) you need to read and write, just use the filesystem. The Environment class has functions that will return well-known per application and per-user locations where you can store anything you want.

    Edit

    I’m not sure if this is what you’re asking, but here it goes. Let’s say you have a class called Document that contains some text and some images, which are rendered in some unspecified way. So basically it would look like this:

    [Serializable]
    class Document
    {
        public string Text { get; set; }
        public Image[] Images { get; set; }
    }
    

    Not sure what Image is, I just made it up. Using the .NET serialization functions you can turn this into a byte stream:

    Document doc = GetDocumentFromUI();
    
    MemoryStream stm = new MemoryStream(1024);
    BinaryFormatter fmt = new BinaryFormatter();
    fmt.Serialize(stm, doc);
    byte[] data = stm.ToArray();
    

    Which you can then save to a file. Then you can load the file and turn it into a document:

    byte[] data = LoadDocumentFromDisk();
    
    BinaryFormatter fmt = new BinaryFormatter();
    MemoryStream stm = new MemoryStream(data);
    stm.Position = 0;
    Document doc = fmt.Deserialize(stm) as Document;
    

    This is very rough obviously, but you can serialize and deserialize most objects in .NET, including some of the built-in types as well.

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

Sidebar

Related Questions

Wanting to create custom data annotation validation. Are there any useful guides / samples
Are there any libraries or guides for how to read and parse binary data
Are there any tutorials or guides out there that anyone knows of that will
Is there any quick guide/reference to list all the countries and its states/provinces? Like
are there any good guides as to which events happen in which order (and
Are there any good guides on how to implement a custom role provider which
Are there any guides or documentation for adding 64-bit support to a KMDF driver?
Are there any guides/gems available that allow you to attach files to a comment.
Are there any reference guides or tutorials for writing a MIPS assembler?
Are there any good guides on making WPF applications 508 compliant? For example, does

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.