try
{
Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog dlg = new Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog
{
ShowPlacesList = true,
Multiselect = false,
InitialDirectory = "",
IsFolderPicker = false,
AddToMostRecentlyUsedList = false,
EnsurePathExists = true,
EnsureFileExists = true,
EnsureValidNames = true,
Title = "Open Model"
//DefaultDirectory = ""
//EnsureReadOnly = false
//AllowNonFileSystemItems = false
};
dlg.Filters.Add(new Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogFilter("Text Files", "*.txt"));
if (dlg.ShowDialog() == Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogResult.Ok)
{
return dlg.FileName;
}
}
catch (System.PlatformNotSupportedException)
{
//TODO: Support will added for not supported platforms
}
return null;
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.