Visual Studio Code can be used as hex editor

By installing this extension: https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor

 

How to play an entire folder containing *.mp3 files from OneDrive on iOS / iPhone

Yes, it is a paid app if you want to play an entire folder containing mp3 files from OneDrive, but it does the job well.

 

.NET C# FileInfo class does NOT support uri’s like file:/// or file:/

The code:

string assemblyPath = “file:///C:/Temp/ConsoleApp1/ConsoleApp1/bin/Debug/ConsoleApp1.exe”;

FileInfo assemblyPathFileInfo = new FileInfo(assemblyPath);

Will throw the error System.NotSupportedException: ‘The given path’s format is not supported.’

I encountered this problem, when I wanted to get the location of an .NET console executable, by using:

System.Reflection.Assembly.GetExecutingAssembly().CodeBase;

 

using System;

using System.Collections.Generic;

using System.IO;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace ConsoleApp1

{

    class Program

    {

        static void Main(string[] args)

        {

            string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;

            Console.WriteLine($”Exe is located at {nameof(assemblyPath)} [{assemblyPath}”);

 

            Uri assemblyPathAsUri = new Uri(assemblyPath);

            string assemblyAbsolutePath = assemblyPathAsUri.AbsolutePath;

            Console.WriteLine($”Exe is located at {nameof(assemblyAbsolutePath)} [{assemblyAbsolutePath}”);

 

            string assemblyFolder = Path.GetDirectoryName(assemblyAbsolutePath);

            Console.WriteLine($”Exe is located in {nameof(assemblyFolder)} [{assemblyFolder}”);

 

            Console.ReadLine();

        }

    }

}

<

p style=”background: #1e1e1e”>
 

 

Result:

Exe is located at assemblyPath [file:///C:/Temp/ConsoleApp1/ConsoleApp1/bin/Debug/ConsoleApp1.exe

Exe is located at assemblyAbsolutePath [C:/Temp/ConsoleApp1/ConsoleApp1/bin/Debug/ConsoleApp1.exe

Exe is located in assemblyFolder [C:\Temp\ConsoleApp1\ConsoleApp1\bin\Debug

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.