开发者

how to extract only server names in c#

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜