像PSP网上联机那样,无线网卡通过驱动获取PSP的数据,联机平台获取无线网卡的数据再发到外网,联机平台怎样获取无线网卡数据?

解决方案 »

  1.   

    一样的java.net.InetAddress获取方式吧
      

  2.   

    java.net.InetAddress
    这个应该只是获得IP吧.这种读网卡信息的事有平台性,JAVA很难做,在WIN下 可以考虑JNI,在LINUX下可以直接跑命令
      

  3.   

    用 java.net.InetAddress 估计程序不健壮
    这个用C++好现实吧
      

  4.   

    java不能实现吧,java只能访问到包的一层.
    楼主是想得到比特流或帧吧.
      

  5.   

    在WIN下 可以考虑JNI,在LINUX下可以直接跑命令
      

  6.   

        import java.io.*;
        import java.net.*;
        import java.util.*;
        import static java.lang.System.out;    public class ListNets 
        {
            public static void main(String args[]) throws SocketException {
                Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
                for (NetworkInterface netint : Collections.list(nets))
                    displayInterfaceInformation(netint);
            }        static void displayInterfaceInformation(NetworkInterface netint) throws SocketException {
                out.printf("Display name: %s\n", netint.getDisplayName());
                out.printf("Name: %s\n", netint.getName());
                Enumeration<InetAddress> inetAddresses = netint.getInetAddresses();
                for (InetAddress inetAddress : Collections.list(inetAddresses)) {
                    out.printf("InetAddress: %s\n", inetAddress);
                }
                out.printf("\n");
             }
        }  The following is sample output from the example program:    Display name: bge0
        Name: bge0
        InetAddress: /fe80:0:0:0:203:baff:fef2:e99d%2
        InetAddress: /121.153.225.59    Display name: lo0
        Name: lo0
        InetAddress: /0:0:0:0:0:0:0:1%1
        InetAddress: /127.0.0.1
    使用NetworkInterface,你可以获得你机器上的多块网卡数据
      

  7.   

    Java对硬件的直接支持不成,这也不是Java的特长,这方面的活儿还是找C做吧
      

  8.   


    有两个项目都叫jpcap,不过功能差不多,都是截获数据包