.NET 4.x OpenFileDialog В Console Application - C#
Формулировка задачи:
Вечер добрый. Помогите пожалуйста, хочу вывести диалог выбора файлов в консольной программе, но ничего не происходит, а именно выводится только пустая консоль. Помогите решить проблему. Вот сам код:
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Win32;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.FileName = "Document";
- dlg.DefaultExt = ".txt";
- dlg.Filter = "Text documents (.txt)|*.txt";
- dlg.ShowDialog();
- }
- }
- }
Решение задачи: «.NET 4.x OpenFileDialog В Console Application»
textual
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Win32;
- namespace ConsoleApplication3
- {
- class Program
- {
- [STAThread]
- static void Main(string[] args)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.FileName = "Document";
- dlg.DefaultExt = ".txt";
- dlg.Filter = "Text documents (.txt)|*.txt";
- dlg.ShowDialog();
- }
- }
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д