📄 class1.cs
字号:
using System;
using System.Data;
using System.IO;
namespace ReadXMLdoc
{
/// <summary>
/// An arbitrary class to encapsulate Main.
/// </summary>
class Class1
{
/// <summary>
/// Entry point to the assembly.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length != 1)
return;
// Open the XML file and read into a DataSet.
FileStream fs =
new FileStream (args[0], FileMode.Open);
DataSet ds = new DataSet();
ds.ReadXml(fs);
// Use a DataTable to display the members.
DataTable mt = ds.Tables["member"];
for (int row = 0; row < mt.Rows.Count; row++)
{
for (int col = 0; col < mt.Columns.Count-1; col++)
{
Console.WriteLine("{0,-10}{1}",
mt.Columns[col].Caption,
mt.Rows[row][col].ToString().Trim());
}
Console.WriteLine();
}
fs.Close();
}
/// <summary>
/// This method does something.
/// </summary>
public void Foo() {}
/// <summary>
/// This method doesn't do anything.
/// </summary>
public void Bar() {}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -