2012-08-09 3 views
0

내 솔루션에서 xml에 액세스하려면 어떻게해야합니까? 일반적으로 bin/Debug /로 이동해야합니다 ... 이미지 (응용 프로그램 루트)에 표시된 위치에 액세스 할 수 있습니까?빈 대신 솔루션 xml에 액세스

enter image description here

XDocument rssFeed = XDocument.Load("sampleFeed1.xml"); 

답변

1

당신은 Server.MapPath을 시도 했습니까? Default.aspx를 위해 일해야

string path=Server.MapPath("~/samplefeed1.xml"); 
XDocument rssFeed = XDocument.Load(path); 
0

. 이 매개 변수의로

XDocument rssFeed = XDocument.Load("/sampleFeed1.xml"); 

부하() 메소드는 URI을 시도 - 경로가 올바른지 경우 작동합니다.

편집 : Shyju는 물결 무늬가 있습니다 (이것은 당신을위한 루트를 찾습니다)

관련 문제