C # Directory.Exists ipv6 version

I am using Directory.Exists(uncPath) with a UNC loop, now it fails if I use a standard IPv6 address. Is code available that can take care of all unc-ipv4 / ipv6 / machiname formats?

I am currently converting my ipv6 address to something like 2001-0-234-c1ab-0-a0-aabc-3e.ipv6-literal.net , and it works, but Ipv6 itself can be presented in several formats. I need something that will handle all formats.

+6
source share
1 answer

Ipv6-literal.net notation is the only way to use IPv6 UNC for windows.

You need to take your IPv6 litteral and replace : with - , % with s and add ipv6-literal.net .

+5
source

Source: https://habr.com/ru/post/905803/


All Articles