?? 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 + -