可以,参考
Select Case e.Path
Case "test.htm", ""
msgbox(e.request.UserAgent )
Dim agent As String = e.request.UserAgent
If agent.contains("MicroMessenger") Then
msgbox("微信")
Else
Dim flag As Boolean = False
Dim keywords As String() = {"Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser"}
'排除 Windows 桌面系统
If Not agent.Contains("Windows NT") OrElse (agent.Contains("Windows NT") AndAlso agent.Contains("compatible; MSIE 9.0;")) Then
'排除 苹果桌面系统
If Not agent.Contains("Windows NT") AndAlso Not agent.Contains("Macintosh") Then
For Each item As String In keywords
If agent.Contains(item) Then
msgbox(item)
flag = True
Exit For
End If
Next
End If
End If
If flag Then
msgbox("手机")
Else
msgbox("电脑")
End If
End If
End Select
https://docs.microsoft.com/zh-cn/dotnet/api/system.net.httplistenerrequest?redirectedfrom=MSDN&view=netframework-4.7.2