andruhovski icon

FileInfo De,o

andruhovski | PRO | 09/10/18 10:34:47 AM UTC | 0 ⭐ | 619 👁️ | Never ⏰ | []
C# |

760 B

|

None

|

0 👍

/

0 👎

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