c# - How to pull the server name from a UNC -


Can anyone tell me how to pull the name of the server from the UNC?

ex.

// servername / directory / directory

EDIT: I'm sorry, but it seems that I need to clarify the mistake: the path is actually more like:

// servername / d $ / directory

I know that it can change some things

how URI :

  Uri Yuri = new ury (@ "\\ servername \ D $ \ directory "); String [] segs = uri.Segments; String s = "http: //" + Uuri.Host + "/" + string.Join ("/", segs, 2, segs.Length - 2) + "/";  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -