⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utility.cs

📁 移动设备的 LINQ 编程介绍 .NET Compact Framework 版 LINQ 的特性
💻 CS
字号:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace Demo1___LinqToObjects
{
	static class Utility
	{
		public static string[] ReadAllLines(string path)
		{
			string[] lines = null;

			if (!File.Exists(path))
				throw new FileNotFoundException(path);

			using (StreamReader sr = File.OpenText(path))
			{
				List<string> lineList = new List<string>();
				string line;
				while ((line = sr.ReadLine()) != null)
				{
					lineList.Add(line);
				}
				lines = lineList.ToArray();
			}

			return lines;
		}
	}
}

⌨️ 快捷键说明

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