获取应用程序的根Url

 

 

 VB代码
    Public Function ApplicationRootUrl() As String
        
Dim req As HttpRequest = HttpContext.Current.Request
        
Return req.Url.GetLeftPart(System.UriPartial.Authority) + req.ApplicationPath & "/"
    
End Function

    
'调用方式如下:
    ApplicationRootUrl() & "prg/if/ifShowMsgAddUp.aspx"
    
    
'结果:http://localhost:8010/iOffice/prg/if/ifShowMsgAddUp.aspx


 

 

相关文章:

  • 2021-08-16
  • 2021-06-20
  • 2021-08-13
  • 2022-12-23
  • 2021-11-19
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-07-01
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案