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 237 views
1 answer 324 views
1 answer 178 views
2 answers 139 views
1 answer 318 views
3 answers 295 views
2 answers 383 views
...