Edit: Please carefully read the OPs question and all its comments before releasing this. The question of the name of the OPs is NOT EXACTLY what she wanted. My answer gave her what she needed to solve her problem. That is why she voted for the answer. Yes, Joels’s answer is correct if he specifically answers the title question. But, after reading her comments, you will see that not quite what she was looking for. Thanks.
...
string strFullPath = @"C:\Users\Ronny\Desktop\Sources\Danny\kawas\trunk\csharp\ImportME\XukMe\bin\Debug\DannyGoXuk.DTDs.xhtml-math-svg-flat.dtd";
string strDirName;
int intLocation, intLength;
intLength = strFullPath.Length;
intLocation = strFullPath.IndexOf("DTDs");
strDirName = strFullPath.Substring(0, intLocation);
textBox2.Text = strDirName;