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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:24:48+00:00 2026-06-13T18:24:48+00:00

I have an application that uses a template file and a CSV file. It

  • 0

I have an application that uses a template file and a CSV file. It works perfectly fine since I do have the said files on my computer and I am referencing their paths. The only thing I want to do is that when the software is published and installed (and the said files are in the Resources folder so it would make them an embedded resource), the csv and template files would be copied to a directory folder that my program would use. Preferably the paths it would be copied to would be something like this : “C:\FILES” + template.dotx .

Now how do I get/retrieve the said files from the Resources Folder in my software into a new folder?

  • 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-13T18:24:49+00:00Added an answer on June 13, 2026 at 6:24 pm

    You could call

    System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
    

    And inspect which embedded resources are accessible. Then you can compare that against what you are passing in to see if you are indeed accomplishing what you expected to.

    string FileExtractTo = "C:\FILES";
    DirectoryInfo dirInfo = new DirectoryInfo(FileExtractTo);
    
    if (!dirInfo.Exists())
        dirInfo.Create();
    
    using (Stream input = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
    using (Stream output = File.Create(FileExtractTo + "\template.dotx"))
    {
        CopyStream(input, output);
    }
    

    CopyStream Method:

    public static void CopyStream(Stream input, Stream output)
    {
        // Insert null checking here for production
        byte[] buffer = new byte[8192];
    
        int bytesRead;
        while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
        {
            output.Write(buffer, 0, bytesRead);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that uses treeview in wpf with mvvm. The treeitem template
I have an Rails 3.1 app that uses template inheritance and that works great:
I have an application that uses a ResourceDictionary to set the styles, which it
I have an application that uses Hibernate. It generated the following SQL statement. I
I have an application that uses multiple WebViews. Nowhere do I set the priority
I have an application that uses RPC for interprocess communications. Turns out that synchronous
I have an application that uses rest to communicate to a server, i would
I have an application that uses CoreData. I previously had a class named Marker
I have an application that uses the Paperclip plugin for image upload. Now that
We have an application that uses Hibernate's 2nd level caching to avoid database hits.

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.