Use OpenFileDialog.SafeFileName
OpenFileDialog.SafeFileName
Gets the file name and extension for the file selected in the dialog box. The file name does not include the path.
More Related Contents:
- How do I use OpenFileDialog to select a folder?
- Select either a file or folder from the same dialog in .NET
- C# OpenFileDialog Lock To Directory
- Interaction between forms — How to change a control of a form from another form?
- Is there a string math evaluator in .NET?
- How do I get the current username in .NET using C#?
- Display lines number in Stack Trace for .NET assembly in Release mode
- How can I programmatically generate keypress events in C#?
- Generics in C#, using type of a variable as parameter [duplicate]
- How to elevate privileges only when required?
- How do I use a C# keyword as a property name?
- Loop through all the resources in a .resx file
- How do you find out when you’ve been loaded via XML Serialization?
- The calling thread cannot access this object because a different thread owns it [duplicate]
- How to hide desktop icons programmatically?
- Easier way of writing null or empty?
- How to run commands on SSH server in C#?
- How to run something in the STA thread?
- Why use try {} finally {} with an empty try block?
- Screen Resolution Problem In WPF?
- What is type-safe in .net?
- Finding property differences between two C# objects
- Thread Safe Properties in C#
- The lack of non-capturing Task.Yield forces me to use Task.Run, why follow that?
- Finding information about all serial devices connected through USB in C#
- Adding a select all shortcut (Ctrl + A) to a .net listview?
- Heap versus Stack allocation implications (.NET)
- Send message to a Windows process (not its main window)
- Passing a variable between Windows Forms forms
- Compare two Color objects