How to get computer name in C#

1 Answer

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

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = Environment.MachineName;

        }
    }
}




/*
 * run:
 *
 * "SK-G8B3QP"
 * 
 */

 



answered Aug 11, 2023 by avibootz

Related questions

1 answer 166 views
1 answer 153 views
1 answer 197 views
1 answer 328 views
...