How Can I Remove The 'file:\\' From the Return Value of Path.GetDirectoryName() in C#

Posted by Nano HE on Stack Overflow See other posts from Stack Overflow or by Nano HE
Published on 2010-06-01T05:42:10Z Indexed on 2010/06/01 5:53 UTC
Read the original article Hit count: 160

Filed under:
|
|
string path = Path.GetDirectoryName(
                     Assembly.GetAssembly(typeof(MyClass)).CodeBase);

output:

file:\d:\learning\cs\test\test.xml

What's the best way to return only d:\learning\cs\test\test.xml

file:\\ will throw exception when I call doc.Save(returnPath) ,however doc.Load(returnPath); works well. Thank you.

© Stack Overflow or respective owner

Related posts about c#

Related posts about path