---
title: "How use relative path in C#."  
description: "How use relative path in C#."  
author: "Kenny Tangnde"  
published: 2011-10-11  
updated: 2011-10-12  
canonical: https://www.mindstick.com/forum/319/how-use-relative-path-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How use relative path in C#.

Hi all,

How use [relative](https://www.mindstick.com/interview/33881/overview-of-relative-absolute-fixed-and-sticky-positioning-in-css) [path](https://www.mindstick.com/articles/44333/4-expert-tips-on-how-to-pick-the-right-career-path) in C#.

Such as:

con = new OleDbConnection(@"[provider](https://answers.mindstick.com/qa/92701/who-is-the-best-telecom-solution-provider)=microsoft.jet.oledb.4.0;[data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) scource=C:\MyProject\Product.mdb");

thanks.\

## Replies

### Reply by Uttam Misra

**Aken ...here you go..\**https://www.mindstick.com/DeveloperSection/Beginner\
Join mindstick beginners section... \
Cheers!

### Reply by Chris Anderson

Post is removed by the Admin.

### Reply by Kenny Tangnde

Hi Rohit,

You can give me some website address to learn SQL?

thanks in advance.

### Reply by Kenny Tangnde

Hi Rohit,

thanks for your help.

### Reply by Chris Anderson

Hi,\
\
You can use relative path by using GetFullPath method of the Path class that exist in the System.IO namespace.\
Try this:\
Console.WriteLine("The relative path 'file.txt' " + System.IO.Path.GetFullPath("file.txt"));


---

Original Source: https://www.mindstick.com/forum/319/how-use-relative-path-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
