Advertisement
andruhovski

FileInfo De,o

Sep 10th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8.  
  9. namespace Demo20180906
  10. {
  11.     class Program
  12.     {
  13.         [STAThread]
  14.         static void Main(string[] args)
  15.         {
  16.             System.Windows.Forms.OpenFileDialog openDlg =
  17.                 new System.Windows.Forms.OpenFileDialog();
  18.             if (openDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  19.             {
  20.                 Console.WriteLine(openDlg.FileName);
  21.                 var fi = new FileInfo(openDlg.FileName);
  22.                 Console.WriteLine(fi.Length);
  23.  
  24.                 Console.WriteLine(Path.GetFileNameWithoutExtension(openDlg.FileName));
  25.             }
  26.            
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement