เรียกใช้ .xml มาเป็นแบบ isolated storage ทำอย่างไรครับ

Last post 9 Apr 2011 16:03 by aaron. 8 replies.
Page 2 of 2 (9 items) < Previous 1 2
Sort Posts: Previous Next
  • 9 Apr 2011 16:03 In reply to

    • aaron
    • Top 25 Contributor
    • Joined on 25 Jun 2010
    • Posts 25

    Re: เรียกใช้ .xml มาเป็นแบบ isolated storage ทำอย่างไรครับ

    ทำได้แล้วนะครับ  ผมเขียนประมาณนี้ครับ

    private void searchBttn_Click(object sender, RoutedEventArgs e)
            {
                var input = inVocab.Text;
                XDocument loadData = XDocument.Load("vocab.xml");
                var data = from query in loadData.Descendants("Doc")
                           where query.Element("esearch").Value == input
                           select new Vocabulary
                           {
                               Esearch = (string)query.Element("esearch"),
                               Eentry = (string)query.Element("eentry"),
                               Tentry = (string)query.Element("tentry"),
                               Ecat = (string)query.Element("ecat"),
                               Ethai = (string)query.Element("ethai"),
                               Esyn = (string)query.Element("esyn"),
                               Id = (int)query.Element("id")
                           };
                outputListbox.ItemsSource = data;
            }

    ขอบคุณสำหรับความช่วยเหลือครับ

Page 2 of 2 (9 items) < Previous 1 2