📄 class1.cs
字号:
using System;
using System.IO;
using System.Windows.Forms;
namespace FileDialog
{
class FileDialogApp
{
private static OpenFileDialog ofd;
[STAThread]
static void Main(string[] args)
{
ofd = new OpenFileDialog();
string s = Path.GetDirectoryName(
Path.GetDirectoryName(
Directory.GetCurrentDirectory()));
ofd.InitialDirectory = s;
ofd.FileOk +=
new System.ComponentModel.CancelEventHandler(
ofd_OK);
ofd.ShowDialog();
}
public static void ofd_OK (object sender,
System.ComponentModel.CancelEventArgs e)
{
StreamReader sr = new StreamReader(ofd.FileName);
string s;
while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
sr.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -