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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:08:14+00:00 2026-05-18T22:08:14+00:00

writing to a text file is working good…But my problem is text file is

  • 0

writing to a text file is working good…But my problem is text file is created in different path….

Here is my code…

var _logFolderPath = Path.Combine(textboxPath.Text.Trim(), "log");
string[] subdirectoryEntries = Directory.GetDirectories(Path.Combine(txtBoxInput.Text, "RM"));

foreach (string subdirectory in subdirectoryEntries)
{
string[] x = Directory.GetFiles(subdirectory);
DirectoryInfo Folder = new DirectoryInfo(textboxPath.Text);
............
}

and

using (var dest = File.AppendText(Path.Combine(_logFolderPath,subdirectory+ ".txt")))

Here i have to store the subdirectory named text file in _logFolderPath path….But the text files are generared in the subdirectory path…I just need the name of the subdirectory to be created as a text file in _logFolderPath path…How to get the name of the subdirectory alone….Any suggestion?

  • 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-18T22:08:14+00:00Added an answer on May 18, 2026 at 10:08 pm

    Have a look at using DirectoryInfo and DirectoryInfo.Name Property

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

Sidebar

Related Questions

I have created a text file in Unix environment using Java code. For writing
I have a created text file in unix enviroment using java code. For writing
I'm writing code to read in a 7x15 block of text in a file
I'm writing to a text file using the following declaration: void create_out_file(char file_name[],long double
I'm writing a small application in C that reads a simple text file and
I'm writing an elisp module that requires an external text file. For the curious,
i am writing a viewer using datagridview to load a text file and display
I'm working with a very big text file (755Mb). I need to sort the
i created a text file list.txt in commonapplicationdatafolder by using the following VBscript.i am
I'm using the following working code to decrypt a file: #include <openssl/aes.h> #include <stdio.h>

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.