基于文字水印的谈判系统设计与实现_毕业论文(编辑修改稿)内容摘要:

public void insertString(int offs, String str, AttributeSet a) throws BadLocationException{ if(getLength() == maxSize){ return。 } if(getLength() + () maxSize){ int i = maxSize getLength()。 str = (0, i)。 } if((str).matches()){ 淮阴师范学院毕业论文(设计) 15 (offs, str, a)。 } } } /** * 发送登陆信息 */ private void sendLoginMessage(){ char[] pw = ()。 String userId= (String)()。 String password = new String(pw)。 if (!()amp。 amp。 !()){ if(loginHandle != null){ ((userId).intValue(), password)。 } } else { (false)。 (this, html用户号码和密码不能为空 br用户号码只能是 110位数字br密码必须是字符和数字 /html, 登录消息 , )。 ()。 (true)。 } } /** * 清除文本内容 */ public void clearTextContent(){ (1)。 ()。 } /** * 从 txt文本文档中读取历史登陆的账号信息 * @return */ public VectorString readUserIDFromFile(){ try { BufferedReader br=new BufferedReader(new FileReader(Info//))。 String msg = null。 while((msg = ()) != null){ String temp = ()。 淮阴师范学院毕业论文(设计) 16 if (!()){ if ( !(temp)){ (temp)。 } } } } catch (Exception e) { ()。 } return userID。 } } 聊天界面及聊天接口代码 /** * @() 2020226 * Copy Right Information : 淮阴师范学院 计算机科学与技术学院(软件工程) * @author : 刘 超(计科 0903 学号: 210910018) * Project : 基于文字水印谈判系统的设计与实现 * JDK version used : * Comments : java类 * Environment : Win7/Win8/Win XP * Version : * Sr Date Modified By : 淮阴师范学院毕业论文(设计) 17 * null **/ package。 import resource.*。 /** * 客户端的接口 202027 * * @author 刘 超 * @version * @since (建议 ) */ public interface IClient { /** * 发送信息包 * @param packet */ public void sendChatMessage(MessagePacket packet)。 /** * 清空函数 */ public void clear()。 } 数据库操作函数及代码实现 /** * @() 2020226 * Copy Right Information : 淮阴师范学院 计算机科学与技术学院(软件工程) * @author : 刘 超(计科 0903 学号: 210910018) * Project : 基于文字水印谈判系统的设计与实现 * JDK version used : * Comments : java类 * Environment : Win7/Win8/Win XP * Version : * Sr Date Modified By : * null **/ package server。 import。 import。 import。 import。 import。 import。 import。 淮阴师范学院毕业论文(设计) 18 import。 import resource.*。 /** * 数据库操作类 * @author 刘 超 * */ public class BaseDaoApp implements IBaseDao { private Connection con = null。 public static final String DRIVER=。 public static final String URL=jdbc:jtds: public static final String USER_NAME=sa。 public static final String USER_PASS=123。 private Connection getConnection() { try{ (DRIVER)。 con=(URL,USER_NAME,USER_PASS)。 }catch(Exception e){ ()。 } return con。 } public void closeAll(Connection con,Statement st,ResultSet rs){ try{ if(con!=null){()。 } if(st!=null){()。 } if(rs!=null){()。 } }catch(Exception e){ ()。 } } public UserInfo login(UserInfo user) { int userID = ()。 String password = ()。 String queryString = select * from t_userinfo where userID =? and password=?。 Connection con = ()。 ResultSet rs。 UserInfo userinfo = null。 try { PreparedStatement ps = (queryString)。 (1, userID)。 淮阴师范学院毕业论文(设计) 19 (2, password)。 rs = ()。 while (()) { int ID = (1)。 String nickName = (2)。 String pwd = (3)。 String sex = (4)。 int age = (5)。 int departID = (6)。 String phone = (7)。 String = (8)。 String name = (9)。 String iconPath = (10)。 String address = (11)。 userinfo = new UserInfo(ID, nickName, pwd, sex, age, departID, phone, , name, iconPath, address)。 } return userinfo。 } catch (SQLException e) { ()。 } return null。 } public VectorDepartment getDepartments() { String queryStr = select * from t_department。 Connection con = ()。 ResultSet rs。 VectorDepartment department = new VectorDepartment()。 try { PreparedStatement ps = (queryStr)。 rs = ()。 while (()) { int departID = (1)。 String departName = (2)。 String departDepict = (3)。 Department depart = new Department()。 (departID)。 (departName)。 (departDepict)。 (depart)。 } 淮阴师范学院毕业论文(设计) 20 return department。 } catch (SQLException e) { ()。 } return null。 } public VectorUserInfo onLineUsers(VectorInteger userID) { int size = ()。 (onLineUsers count + size)。 Connection con = ()。 ResultSet rs。 PreparedStatement ps。 VectorUserInfo onLineUsers = new VectorUserInfo()。 int index = 0。 while (size 0) { String queryString = select * from t_userinfo where userID = ?。 try { ps = (queryString)。 (1, (index))。 rs = ()。 while (()) { int ID = (1)。 String nickName = (2)。 String pwd = (3)。 String sex = (4)。 int age = (5)。 int departID = (6)。 String phone = (7)。 String = (8)。 String name = (9)。 String iconPath。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。