는이 같은 파일에 XML 데이터의 덩어리를 작성하는 것을 시도하고있다 :XmlWriter가이 코드에서 오류를 던지는 이유는 무엇입니까?
using (XmlWriter writer = XmlWriter.Create("D://project//data//" + i + ".xml"))
을하지만, 다음과 같은 오류 제공 : 내가 XmlReader
를 사용하여 XML을 읽고있다 할 때, 그러나
Server Error in '/' Application.
Could not find a part of the path '
D:\project\data\1.xml
'.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.IO.DirectoryNotFoundException
: Could not find a part of the path 'D:\project\data\1.xml
'.
을 :
XmlReader reader = XmlReader.Create("d://project//data.xml");
리더를 원활하게 만들고 오류를주지 않습니다. 나는 왜 그런지 이해하지 못한다.
편집 : 죄송합니다 모두 폴더 경로가 동일하고 올바른가 D입니다 : //project//data.xml
폴더가 다릅니다. 아마도 d : // project_elysian/D : // project // data //는 존재하지 않습니다. –
귀하의 질문에 예외가 사라진 것 같습니다 : 디렉토리가 존재하지 않습니다, – Schwarzie2478