>
Winform code:
LINQ and some difference between XDocument and XElement            XElement config = XElement.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
LINQ and some difference between XDocument and XElement            
foreach (XElement xe in config.Elements())
LINQ and some difference between XDocument and XElement                textBox1.Text 
+= (xe.Name.ToString() + Environment.NewLine);
LINQ and some difference between XDocument and XElement
LINQ and some difference between XDocument and XElement            XDocument xd 
= XDocument.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
LINQ and some difference between XDocument and XElement            
foreach (XElement xe in xd.Elements())
LINQ and some difference between XDocument and XElement                textBox1.Text 
+= (xe.Name.ToString() + Environment.NewLine);

Output:
MyConfig
configSections
connectionStrings
configuration
);
There, u can c the differences between XElement and XDocument :)
In the past, I wrote some XML operation tutorials in non-LINQ time: http://hi.baidu.com/feishunji/blog/category/Xml

Marius Bancila has also contributed some good introduction articles of LINQ:
Introduction to LINQ, Part 1: LINQ to Objects
Introduction to LINQ, Part 2: LINQ to XML
Introduction to LINQ, Part 3: LINQ to SQL

相关文章:

  • 2019-01-09
  • 2021-10-13
  • 2021-10-23
  • 2021-08-30
  • 2022-01-04
  • 2021-08-27
  • 2021-09-07
  • 2021-09-15
猜你喜欢
  • 2022-01-22
  • 2021-11-03
  • 2021-08-01
  • 2021-11-18
  • 2021-10-28
  • 2021-05-03
  • 2021-08-07
相关资源
相似解决方案