MyFileNameStr = String.Empty; MyDrawingFile = String.Empty; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); openFileDialog1.Title = "Select Your Attachment File :- "; openFileDialog1.AutoUpgradeEnabled = true; openFileDialog1.Multiselect = true; openFileDialog1.SupportMultiDottedExtensions = true; openFileDialog1.CheckFileExists = false; openFileDialog1.CheckPathExists = true; openFileDialog1.ValidateNames = false; openFileDialog1.AddExtension = true; openFileDialog1.Filter = "exe files | *.exe|All files (*.*)|*.*"; openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true; openFileDialog1.ReadOnlyChecked = true; openFileDialog1.ShowReadOnly = true; //????????????????????? Error exception at below line if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MyDrawingFile = System.IO.Path.GetFileName(openFileDialog1.FileName).ToString(); MyFileNameStr = System.IO.Path.GetFileNameWithoutExtension(openFileDialog1.FileName).ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)