后台调用前台JS(查看客户端IE版本)

时间:2021-04-08 16:48:11

1、前端代码
    </form>    //注意放在form下面
<script>
    function readRegedit() {
        var obj = new ActiveXObject("WScript.Shell");
        var s="HKEY_CURRENT_USER\\SOFTWARE\\Universal Travel Group\\Client\\Parameter";
        var sNic = obj.RegRead(s);
        alert(sNic);
    }
    </script>

2、后台代码

protected void Button1_Click1(object sender, EventArgs e)
        {
            PageContext.RegisterStartupScript("readRegedit");
        }