Landei00 Landei00 - 1 year ago 99
C# Question

How to make file path in required format?

I want to compare to images and have to make them first as a Bitmap.

Bitmap bmp1 = new Bitmap(file1);

file1 contains the path as a string in the following format:


But C# need to convert this in the following format:


Is there any possibility to convert the string to the needed format?

Answer Source

One way would be:

file1 = file1.Replace(@"\", @"\\");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download