0

我正在使用代码来恢复密码。当用户请求重置密码时,它会向用户的手机发送一条短信。我的问题是它在运行时给了我这个输出。

==================================================== ==============================

Now Sleeping - 按回车键终止。

但我想自动发送输入信号,这样工作就会自动终止。我该怎么做?

我的代码如下:

                if (rs3.next()) {
                    String port = "COM3"; //Modem Port.
                    int bitRate = 460800; //this is also optional. leave as it is.
                    String modemName = "Huawei E165G"; //this is optional.
                    String modemPin = ""; //Pin code if any have assigned to the modem.
                    String SMSC = "+947100003"; //Message Center Number ex. Mobitel

                    GsmModem gsmModem = new GsmModem();
                    GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC);
                    gsmModem.Sender(mobileno, "Your new password is "+rs3.getString("password")+"  Please change your password in your next login. >>Fast Inventory<<"); // (tp, msg) 
                    System.out.println("Code came here");

                    Statement s2=Db.connectDb().createStatement();
                    s2.executeUpdate("UPDATE user SET lockstatus='0' WHERE uid='"+username.getText()+"'");
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

我正在使用 SMSlib。

4

0 回答 0