string path = Path.GetDirectoryName(
Assembly.GetAssembly(typeof(MyClass)).CodeBase);
de salida:¿Cómo puedo quitar el 'file: \' Desde el valor de retorno de Path.GetDirectoryName() en C#
archivo: \ d: \ aprender \ cs \ test \ test. xml
¿Cuál es la mejor manera de devolver sólo d: \ aprender \ cs \ test \ test.xml
file:\\
lanzará una excepción cuando llamo doc.Save(returnPath)
, sin embargo doc.Load(returnPath)
; funciona bien. Gracias.
posible duplicado de [¿Existe un método de .NET Framework para convertir archivos URI a rutas con letras de unidad?] (Http://stackoverflow.com/questions/278761/is-there-a-net-framework-method- for-converting-file-uris-to-paths-with-drive-le) – nawfal