private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog fileName = new OpenFileDialog();
fileName.InitialDirectory = Application.StartupPath;
fileName.Filter = "所有檔案(*.*)|*.*|選單檔案(*.md)|*.md";
fileName.FilterIndex = 2;
fileName.RestoreDirectory = true;
if (fileName.ShowDialog() == DialogResult.OK) {
//MessageBox.Show(fileName.FileName);
//Stream stream=fileName.OpenFile();
//StreamReader sr = new StreamReader(stream);
//BinaryReader br = new BinaryReader(stream, Encoding.Unicode);
}
}
C# OpenFileDialog用法
轉載於:https://www.cnblogs.com/huangbingzhi/p/4836725.html
相關文章
- c#—OpenFileDialog(開啟檔案對話方塊)和new關鍵字的用法C#
- c# winform窗體之開啟檔案對話方塊openfiledialogC#ORM
- C# ExpandoObject用法C#Object
- C# List用法C#
- C# ArrayList的用法C#
- C# List 用法list<>C#
- C# SendMessage用法C#
- C# peek()的用法C#
- C#中 as is 用法筆記C#筆記
- C# StringBuilder用法C#UI
- C#教程之介面用法C#
- C# SetCursorPos用法C#
- C# List用法詳解C#
- C#裡List的用法C#
- C#中Enum的用法C#
- C# List常用函式用法C#函式
- 【C#】as關鍵字的用法C#
- C#中yield return用法分析C#
- C#中substring ()的用法C#
- C#中DllImport用法彙總C#Import
- C#中Attributes的用法C#
- C# WebSocketSharp 框架的用法C#Web框架
- C#中?和??及?:的用法C#
- 【C#】-Dictionary的詳細用法C#
- C#中dynamic的正確用法C#
- C# 之 static的用法詳解C#
- C# ListView用法詳解 很完整C#View
- C#中SqlParameter的作用與用法C#SQL
- 【C#】反射的用法及效率對比C#反射
- C# Debug和release判斷用法C#
- c# 中常用的對集合的用法C#
- [C#] ??雙問號的意思及用法C#
- 【轉】C#中dynamic的正確用法C#
- C#中File 類的用法 轉載C#
- 關於C#中async/await的用法C#AI
- C#中JavaScriptSerializer幫助類用法例項C#JavaScript
- C#中HashTable簡介和使用用法C#
- C# 中的 Mutex(互斥體)基礎用法C#Mutex