在具有ISA Server的Intranet中获取客户端计算机名称 [英] Get client computer name in intranet that there is ISA Server

查看:60
本文介绍了在具有ISA Server的Intranet中获取客户端计算机名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家
我遇到麻烦了,这对我来说太重要了
我想要连接到我公司内部网中我的网站的用户的计算机名称,但是因为有一项isa服务,所以每台计算机都获得了isa ip,而我无法使用asp.net客户端计算机ip.do,您有使用jQuery的解决方案, Javascript或所有可以帮助ms的东西
在此先感谢

hi experts
i get into trouble,its too essential for me
i want computer name of user that connect to my web site in our intranet of company but because there is isa service ,every computer gets isa ip,and i cant get with asp.net client computer ip.do you have a solution with jQuery,Javascript or every things that can helps ms
thanks in advance

推荐答案

function GetComputerName()
{
    try
    {
        var network = new ActiveXObject('WScript.Network');
        // Show a pop up if it works
        alert(network.computerName);
    }
    catch (e) { }
}




可能也可能不需要IE中的某些特定安全设置设置,以允许浏览器访问ActiveX对象.

ere是有关WScript的更多信息的链接单击此处




It may or may not require some specific security setting setup in IE as well to allow the browser to access the ActiveX object

ere is a link to some more info on WScript Click Here


<script language="c#" runat="server">


       void BtnCheck_Click(Object sender,EventArgs e)
    {
        try
        {
        LblHostName.Text = "";
        IPAddress myIP = IPAddress.Parse(TxtInput.Text);

        IPHostEntry GetIPHost = Dns.GetHostByAddress(myIP);

        LblHostName.Text = "Host Name is: " + GetIPHost.HostName;

        }
        catch(Exception ex)
        {
            LblHostName.Text = "<font color=red>Error:" + ex.Message;
        }
        }

        </script>



您可以尝试...



You can try this ...


亲爱的,

我认为这一定会对U有所帮助
Dear,

I think it will surely help U
<!-- Require jQuery / Anyversion -->
<script language="Javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- Require EasyJQuery After JQuery -->
<script language="Javascript" type="text/javascript" src="http://api.easyjquery.com/easyjquery.js"></script>

<script language="Javascript">
    // 1. Your Data Here
    function my_callback(json) {
        alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY);
    }

    function my_callback2(json) {
        // more information at http://api.easyjquery.com/test/demo-ip.php
        alert("IP :" + json.IP + " nCOUNTRY: " + json.COUNTRY + " City: " + json.cityName + " regionName: " + json.regionName);
    }

    // 2. Setup Callback Function
   // EasyjQuery_Get_IP("my_callback"); // fastest version
    EasyjQuery_Get_IP("my_callback2","full"); // full version

</script>


这篇关于在具有ISA Server的Intranet中获取客户端计算机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆