using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo20180906
{
class Program
{
[STAThread]
static void Main(string[] args)
{
System.Windows.Forms.OpenFileDialog openDlg =
new System.Windows.Forms.OpenFileDialog();
if (openDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Console.WriteLine(openDlg.FileName);
var fi = new FileInfo(openDlg.FileName);
Console.WriteLine(fi.Length);
Console.WriteLine(Path.GetFileNameWithoutExtension(openDlg.FileName));
}
}
}
}
Comments