How to get the full path of the current working directory using WinForms in C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string current_working_directory = Environment.CurrentDirectory;

            MessageBox.Show(current_working_directory);
        }
    }
}




/*
run:

C:\\Users\\ABC\\source\\WinFormsApp1\\bin\\Debug\\net7.0-windows

*/

 



answered Mar 8, 2024 by avibootz

Related questions

2 answers 221 views
1 answer 306 views
1 answer 158 views
2 answers 135 views
1 answer 298 views
3 answers 285 views
2 answers 373 views
...