xsl (스타일 시트)과 함께 xml 파일을 다운로드하고 싶습니다. XML 파일을 다운로드 내 코드는 다음과 같습니다 :xsl 파일로 xml 다운로드
XPathDocument myXPathDoc = new XPathDocument("myxml.xml");
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load("myxsl.xsl");
XmlTextWriter myWriter = new XmlTextWriter("Result.html", null);
myXslTrans.Transform(myXPathDoc, null, myWriter);
string strFullPath = Server.MapPath("Result.html");
string strContents = null;
System.IO.StreamReader objReader = default(System.IO.StreamReader);
objReader = new System.IO.StreamReader(strFullPath);
strContents = objReader.ReadToEnd();
objReader.Close();
//attach that XML file and download on local machine
string attachment = "attachment; filename=" + myWriter;
Response.ClearContent();
Response.ContentType = "text/html";
Response.AddHeader("content-disposition", attachment);
Response.Write(strContents);
내가 구글에서 검색,하지만 해결책을 찾을 수 없다. 이것에 관해서 몇 가지 아이디어를 말해라. 같은 예외를주는 것. 다른 프로세스에서 사용하고 있기 때문에 프로세스가 '~ mypath \ Result.html'파일에 접근 할 수 없다.
Downvoting ??? – akeeseth