如果你用的是Win2000的话,命令行执行
netsh -c interface ip add address "本地连接" IP 掩码 可以修改,用
Runtime.exec()试一下?

解决方案 »

  1.   

    如果是2000/XP,可以使用下面的代码来设置本地IP.//Execute.java
    public class Execute
    {
    private static void setIP(String newip) throws Exception
    {
    Runtime.getRuntime().exec("netsh interface ip set addr \"本地连接\" static "+newip+" 255.255.255.0 192.168.32.1 1");
    }

    public static void main(String[] args) throws Exception
    {
    System.out.println("Begin to set the local ip address\nPlease wait...");
    System.out.println("\nAfter setting the ip, the program will auto exit...");
    setIP("192.168.32.100");
    System.out.println("Set ip successful!");
    }
    }
      

  2.   

    To:abswdy() 
    确实试验过,没有问题啊?
      

  3.   

    我以实验确实可以 我的WIN2000SERVER
      

  4.   

    Check 你的连接名对不对啊?
      

  5.   

    好象不行
    ------------------------------------
    体验速度,体验CSDN新版论坛助手:http://community.csdn.net/Expert/TopicView.asp?id=3108679