Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

relative path c#

var outPutDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly(). CodeBase);
var iconPath = Path.Combine(outPutDirectory, "FolderImg.jpg");
string icon_path = new Uri(iconPath ).LocalPath;
Comment

how to get relative path in c#

Uri file = new Uri(@"c:fooarloplap.txt");
// Must end in a slash to indicate folder
Uri folder = new Uri(@"c:fooar");
string relativePath = 
Uri.UnescapeDataString(
    folder.MakeRelativeUri(file)
        .ToString()
        .Replace('/', Path.DirectorySeparatorChar)
    );
Comment

relative path c#


var myIcon = Resources.MyIconFile;

Comment

PREVIOUS NEXT
Code Example
Csharp :: declarar lista c# 
Csharp :: how to pause a console.writeline in C# 
Csharp :: c# convert string to datetime dd-mm-yyyy hh-mm-ss 
Csharp :: c# remove xml invalid characters 
Csharp :: asp net c# browser cursor wait 
Csharp :: unity datetime to string 
Csharp :: unity how to find the largest value out of 2 numbers 
Csharp :: c# split multiple options 
Csharp :: web client ignore ssl error 
Csharp :: asp.net c# get user email address from AD 
Csharp :: minimum of three numbers 
Csharp :: unity gui button width 
Csharp :: declare multiple variables in for loop C# 
Csharp :: recorrer list c# 
Csharp :: c# max sequence contains no elements 
Csharp :: encode pdf file to base64 c# 
Csharp :: net user add ne user windows 10 
Csharp :: generate random light colors programatically in android 
Csharp :: how to compare time strings in c# 
Csharp :: asp.net core update-database specify environment 
Csharp :: c# faker 
Csharp :: C# Async Function without await 
Csharp :: dotnet create web api 
Csharp :: wait c# 
Csharp :: datatable select c# 
Csharp :: linq where condition c# 
Csharp :: c# delete object 
Csharp :: csharp attributes as generics constraints 
Csharp :: hide component in component menu 
Csharp :: wpf button to return to last window 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =