---
title: "GUID in C#"  
description: "GUID in C#"  
author: "John Smith"  
published: 2010-10-11  
updated: 2011-10-07  
canonical: https://www.mindstick.com/forum/35/guid-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# GUID in C#

How to generate [GUID](https://www.mindstick.com/forum/12585/cast-the-value-returned-from-user-identity-getuserid-to-make-it-a-guid) in C#?\
Please provide me any sample.\
\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams) \

## Replies

### Reply by Anonymous User

Thanks Haider M Rizvi.\
\
This is useful for me.\
\
Thanks.\

### Reply by Anonymous User

Hi John,\
\
Here is an example to show how to generate GUID.\
\

```
string uniqueId = Guid.NewGuid().ToString();
```


---

Original Source: https://www.mindstick.com/forum/35/guid-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
