우리는 제 3자가 우리에게 전화 네비게이션 시스템을 제공하기 위해 구문 분석하는 VXML 프로젝트를 가지고 있습니다. 우리는 메시지를 남기기 위해 ID 코드를 입력해야하며, 나중에 회사에서 검토합니다. 난 그냥이 응용 프로그램을 유지하고있어XMLTextWriters 및 스트림에 관한 질문
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Stream m = new MemoryStream(); //Create Memory Stream - Used to create XML document in Memory
XmlTextWriter XML_Writer = new XmlTextWriter(m, System.Text.Encoding.UTF8);
XML_Writer.Formatting = Formatting.Indented;
XML_Writer.WriteStartDocument();
/* snip - writing a valid XML document */
XML_Writer.WriteEndDocument();
XML_Writer.Flush();
m.Position = 0;
byte[] b = new byte[m.Length];
m.Read(b, 0, (int)m.Length);
XML_Writer.Close();
HttpContext.Current.Response.Write(System.Text.Encoding.UTF8.GetString(b, 0, b.Length));
, 내가 그것을 기록하지 않았다 ...하지만 끝 부분은 나에게 뒤얽힌 보인다 다음과 같이
우리는 현재이 작업을해야합니다.
출력 스트림을 가져 와서 작성된 XML을 가져 오는 것을 알고 있지만 왜 전체 문자열을 처음 읽는 것입니까? 비효율적이지 않습니까?
위의 코드를 작성하는 더 좋은 방법이 있습니까?
예 그래야합니까 –