Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- namespace ConsoleApplication2
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- using (var openFileDialog = new OpenFileDialog())
- {
- openFileDialog.InitialDirectory = "c:\\";
- openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
- openFileDialog.FilterIndex = 2;
- openFileDialog.RestoreDirectory = true;
- if (openFileDialog.ShowDialog() == DialogResult.OK)
- {
- Console.WriteLine(openFileDialog.FileName);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement