---
title: "how to get machine name in c#"  
description: "how to get machine name in c#"  
author: "Anonymous User"  
published: 2013-06-08  
updated: 2013-06-08  
canonical: https://www.mindstick.com/forum/1011/how-to-get-machine-name-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# how to get machine name in c#

Hi [Developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs),\
I want to get machine [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) (e.g. my PC name is "compter-1") using C# line of [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii).Please provide line of code or any [useful](https://www.mindstick.com/articles/12694/how-dolomite-mineral-is-useful-in-human-life) [link](https://www.mindstick.com/articles/23633/link-builder)!\
Thanks in advance.

## Replies

### Reply by Vijay Shukla

Hi lois waisbrooker!below line of code show your machine name (PC-name) .class MachineName { static void Main(string[] args) { Console.WriteLine(Environment.MachineName); Console.ReadKey(); } }


---

Original Source: https://www.mindstick.com/forum/1011/how-to-get-machine-name-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
