writing to a text file in a specific path in c#?
<p>writing to a text file is working good...But my problem is text file is created in different path....</p>

<p>Here is my code...</p>

<pre><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);
............
}
</code></pre>

<p>and</p>

<pre><code>using (var dest = File.AppendText(Path.Combine(_logFolderPath,subdirectory+ ".txt")))
</code></pre>

<p>Here i have to store the <code>subdirectory named text file</code> in <code>_logFolderPath</code> 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 <code>_logFolderPath</code> path...How to get the name of the subdirectory alone....Any suggestion?</p>
