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

📄 processexception.cs

📁 Csharp实例编程百例.rar
💻 CS
字号:
using System;
using System.IO;

public class ProcessException
{
	public static void Main()
	{
		StreamWriter sw = null;

		try
		{
			sw = new StreamWriter(new FileStream("Test.txt",FileMode.Open));
			sw.WriteLine("Hello there");
			Console.WriteLine("Message is written into file Test.txt");
		}
		catch(FileNotFoundException fnfe)
		{
			Console.WriteLine("File "+fnfe.FileName+" not found");
		}
		catch(Exception e)
		{
			Console.WriteLine(e);
		}
		finally
		{
			if (sw!=null)
			{
				sw.Close();
			}
		}
	}
}

⌨️ 快捷键说明

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