nbsp; }
if (sLoginPwd.length() == 0) {
error("Input password please!");
return;
}
//Call .NET XML WebServices
Thread t = new Thread() { //一定要新开线程,避免锁定屏幕
public void run() {
try {
boolean loginResult = service.login(sLoginUserID, sLoginPwd); //Method:Login()
if (loginResult == false) {
error("You have no permission login.");
}
else {
display.setCurrent(MainForm);
}
}
catch (Exception e) {
if (!EXIT_STRING.equals(e.getMessage())) {
e.printStackTrace();
error("Connection problems.\n"
+ "Check your internet/proxy settings.");
}
}
}
};
t.start();
}
OK,到此,你就搞定了!
J2ME call the dotnet Web Services!
简单吧!