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 :: how to duplicate a clip in premiere pro 
Csharp :: check if file exist c# 
Csharp :: c# see if string is int 
Csharp :: windows form textbox password 
Csharp :: fluent assertion exception 
Csharp :: linq get a dictionary key and value c# 
Csharp :: byte array to base64 c# 
Csharp :: unity deactivate component 
Csharp :: remove all array elements c# 
Csharp :: if file exist rename c# 
Csharp :: unity interfaces 
Csharp :: C# monogodb 
Csharp :: declare dictionary c# 
Csharp :: vector3 unity 
Csharp :: datetime in specific format c# 
Csharp :: add a dictionary to another dictionary c# 
Csharp :: c# empty array 
Csharp :: c# find value in datagridview 
Csharp :: how to print statement in c# 
Csharp :: c# kill one excel process 
Csharp :: how to validate if date is a weekday or weekend c# 
Csharp :: c# csvhelper 
Csharp :: unity rotate around axis 
Csharp :: stringbuilder to string c# 
Csharp :: quotes in string f# 
Csharp :: custom click event wpf button 
Csharp :: combobox selected item c# 
Csharp :: run file windows forms 
Csharp :: get number of days between two dates c# 
Csharp :: prevent system shutdown c# 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =