联想天工 802.1x认证 拨号测试

package ZClient;

import ZClient.Dot1X.Dot1XMsgEvent;
import ZClient.Dot1X.Dot1XMsgListener;
import ZClient.Dot1X.NoDeviceException;
import ZClient.Dot1X.NoIPException;
import ZClient.Dot1X.OpenDevException;

public class Test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Dot1X dot1xApp=Dot1X.getDot1XInstance();
		dot1xApp.addDot1XMsgListener(new Dot1XMsgListener() {

			@Override
			public void msgUpdateAction(Dot1XMsgEvent dmEvent) {
				System.out.println(dmEvent.getSource().message);//侦听信息
			}
		});
                for (String string : Dot1X.getDeviceList()) {
                     System.out.println(string);//网卡列表
                }
		try {
			dot1xApp.setDevice(1);//选择网卡
		} catch (NoIPException e2) {
			System.out.println(e2.getMessage());
		} catch (NoDeviceException e) {
			System.out.println(e.getMessage());
		}
		try {
			dot1xApp.setName("02132121", "111111");//用户名 密码
			dot1xApp.Start();//触发认证
		} catch (OpenDevException e1) {
			System.out.println(e1.getMessage());
		}
	}
}

你可能感兴趣的:(java,802.1x认证,联想天工,拨号测试)