How do I convert a path with a drive letter to a UNC path

前端 未结 3 1768
鱼传尺愫
鱼传尺愫 2021-02-19 21:30

How do I convert a path with a drive letter like W:\\Path\\Share to the equivalent unc path like \\\\server\\Share\\File in .Net?

At the comman

3条回答
  •  醉酒成梦
    2021-02-19 22:32

    You can use P/Invoke and call on a native function such as WNetGetUniversalName.

提交回复
热议问题