Select the file and click OK to display the absolute path of the file in the text box.
public void getfilepath()
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Arbitrary files (*. *)|*. *"; //type and description of the file
if (dlg.ShowDialog() == DialogResult.OK) //After the selection is made
{
string filePath = dlg.FileName;
textBox1.Text = filePath;
}
}
Read More:
- How to Export All data in DataGridView to Local Excel
- Hadoop 3.2.0 idea development environment construction and HDFS read write API operation
- C#: How to get the value or text value of the select drop-down list
- Android: How to Start App Automatically
- Sublime text 3 compiles and executes C/C++ programs directly
- C#: How to Use Itextsharp to Manipulate PDF Files
- Summary of unity3d 11 SceneManager scene management usage
- Grep: How to Find All the Files Containing a String in Linux
- How to Add Dfrours Model
- WPF: How to Reference Font Resource File
- How to Use Apt get Command Under Mac OSX
- C# WPF Framework: How to Build Caliburn.Micro Quickly
- The use of Android setgravity()
- [Linux] undefined reference to `itoa’
- Linux: How to Fix undefined reference to `itoa’
- C Language Compilation Error: variably modified ‘* *’ at file scope
- Notes on Linux SCP command using specific port
- Running shell script reports an error: “syntax error near unexpected token solution ‘”
- Latex: How to Modify the Size of the Font
- Could not find an NgModule. Use the skip-import option to skip importing in NgModule