开发者

how to extract only server names in c#

开发者 https://www.devze.com 2023-02-17 00:32 出处:网络
i want to extrac开发者_开发问答t only server names which is starting from \\\\.\\\\ is removed.After extracting server names this string is parsed. how can i do? Look at the Uri class.

i want to extrac开发者_开发问答t only server names which is starting from \\. \\ is removed. After extracting server names this string is parsed. how can i do?


Look at the Uri class.

Uri uri = new Uri(@"\\Myserver\myshare\myfile.txt");
uri.Host == "Myserver"


This is the regex: \\\\.*?\\

0

精彩评论

暂无评论...
验证码 换一张
取 消