computerfilesystem.cs

来自「《圣殿祭司的ASP.NET 2.0开发详解——使用C#》光盘内容.包含了书籍所含」· CS 代码 · 共 33 行

CS
33
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualBasic.Devices;

namespace MyObjectCSharp
{
	public partial class ComputerFileSystem : Form
	{
		public ComputerFileSystem()
		{
			InitializeComponent();
		}

		//读取文件资料
		private void btnRead_Click(object sender, EventArgs e)
		{
			Microsoft.VisualBasic.Devices.Computer myComputer = new Computer();
			try
			{
				txtMsg.Text = myComputer.FileSystem.ReadAllText("C:\\Tmp\\Readme.txt", Encoding.GetEncoding(0));
			}
			catch (Exception ex)
			{
				txtMsg.Text = ex.Message;
			}
		}
	}
}

⌨️ 快捷键说明

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