Don't do the detection yourself. Use System.IO.Path.DirectorySeparatorChar. Also, if you always use Path to manipulate paths then you should get formatting that you need. This also works with URLs.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download
Email codedump link for System.Environment.OSVersion .NET Core 5.0 Framework replacement?