readxml.cs

来自「支持各种栅格图像和矢量图像读取的库」· CS 代码 · 共 43 行

CS
43
字号
using System;using GDAL;/** * <p>Title: GDAL C# readxml example.</p> * <p>Description: A sample app for demonstrating the usage of the XMLNode class.</p> * @author Tamas Szekeres (szekerest@gmail.com) * @version 1.0 *//// <summary>/// A C# based sample for demonstrating the usage of the XMLNode class./// </summary> class ReadXML {		public static void usage() 	{ 		Console.WriteLine("usage example: readxml {xml string}");		System.Environment.Exit(-1);	} 	public static void Main(string[] args) {		if (args.Length != 1) usage();        XMLNode node = new XMLNode(args[0]);                PrintNode(0, node);	}    public static void PrintNode(int recnum, XMLNode node)    {        Console.WriteLine(new String(' ', recnum) + "Type: " + node.Type +            "  Value: " + node.Value);        if (node.Child != null) PrintNode(recnum + 1, node.Child);        if (node.Next != null) PrintNode(recnum, node.Next);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?