小编Ami*_*rya的帖子

使用Java小程序在网页上获取MAC地址

我想创建一个应用程序,其中Web服务器可以获取登录客户端的MAC地址.我能想到的唯一可能的方法是创建一个包含java.net方法的JAVA applet来查找mac地址

我使用javascript调用applet方法,但浏览器不允许执行这些方法.下面是我创建的applet.

import java.applet.*;
import java.awt.*;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;

public class AppletRunner extends Applet{
 // The method that will be automatically called  when the applet is started
    public void init()
    {
// It is required but does not need anything.
    }


//This method gets called when the applet is terminated
//That's when the user goes to another page or exits the browser.
    public void stop()
    {
    // no actions needed here now.
    }


//The …
Run Code Online (Sandbox Code Playgroud)

javascript applet

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

applet ×1

javascript ×1