Extract domain name from URL in C#

前端 未结 4 1648
情深已故
情深已故 2021-01-13 02:01

This question has answer in other languages/platforms but I couldn\'t find a robust solution in C#. Here I\'m looking for the part of URL which we use in

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-13 02:20

    if you need to domain name then you can use URi.hostadress in .net

    if you need the url from content then you need to parse them using regex.

提交回复
热议问题