C# 获取当前项目运行时的域名

///WebHttpContext.Current.Request.Scheme为http
///WebHttpContext.Current.Request.Host 为域名
var host = WebHttpContext.Current.Request.Scheme + "://" + WebHttpContext.Current.Request.Host;//http://test-newWr.com

  string apiUrl = host + "/Images/";

 

posted @ 2021-10-13 09:56  你小子嚣张呀  阅读(506)  评论(0编辑  收藏  举报