Determine Client's Computer Name

后端 未结 7 668
情歌与酒
情歌与酒 2020-11-29 23:41

I am building an intranet site that will display different lists based on the computer name because different computers are in different areas, is there a way (within a cont

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 00:27

    code in VB :

    Dim myIP As IPAddress = IPAddress.Parse(Request.UserHostName)
        Dim GetIPHost As IPHostEntry = Dns.GetHostEntry(myIP)
        Dim compName As List(Of String) = GetIPHost.HostName.ToString.Split("").ToList
    
        return(compName.First)
    

提交回复
热议问题