?? send.java
字號:
package com.cargo.send;
import com.cargo.db.Userdb;
import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;
import com.cargo.model.User;
import com.cargo.model.Car;
import com.cargo.db.Cardb;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: MR</p>
* @author BWM
* @version 1.0
*/
public class Send extends JNote {
private Userdb db = new Userdb();
private Cardb adb = new Cardb();
private Collection coll = new ArrayList();
private int t = 0;
private String[] use = null;
private char PRI = 0, DCS = 8, RD = 0, RP = 0, SRR = 0, MR = 0, PID = 0;
private long default_id = 0;
private char UDHI = 0;
private long SM_ID;
private String FCS;
public Send() {
}
public String[] Logon(String userid) {
coll = db.select(db.WHERE + "id='" + userid + "'");
if (coll != null || !coll.isEmpty()) {
Iterator it = coll.iterator();
if (it.hasNext()) {
User user = (User) it.next();
use = new String[4];
use[0] = user.getUserid();
use[1] = user.getPassword();
use[2] = user.getTel();
use[3] = user.getArea();
coll.clear();
coll = adb.select( db.WHERE + "area='" + use[3] + "'");
if (coll != null || !coll.isEmpty()) {
Iterator ite = coll.iterator();
if (ite.hasNext()) {
Car car = (Car) ite.next();
use[3] = new Integer(car.getTel()).toString();
} else {
use = null;
}
}
}
}
return use;
}
public boolean Send(String time, String msg) {
if (Initface(1, 1, IP)) {
if (LoginNT(use[0], use[1])) {
t = -1;
try {
t = SendMessage((char) 2, (char) 1, use[3], (char) 2, (char) 1, use[4],
PRI, RD, RP, SRR, MR, DCS, PID, time, time, default_id, (char) 0,
msg.length(), msg, SM_ID, FCS);
if (t == 0) {
//發送成功
return true;
}
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
//退出登錄
this.Logout();
this.Exitface();
}
}
}
return false;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -