ImageVerifierCode 换一换
格式:DOCX , 页数:52 ,大小:122.21KB ,
资源ID:22913232      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/22913232.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(JSP图片上传放大缩小裁减的源代码Word文件下载.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

JSP图片上传放大缩小裁减的源代码Word文件下载.docx

1、有预览,能显示图片长宽和大小(file size)最好。本人结帖率是99.87%, 可用分+ 非常感谢!如果没有JSP源代码,PHP源代码也可以。package myBean;import java.io.*;public class uploadpic String picPath;/图片路径 (如:F:picturea.gif) public String pictype;/设置图片的后缀名 FileInputStream in; int piclength;/设置图片的最大kb public void setpicPath(String picPath)/获得图片的路径 this.pic

2、Path=picPath; public void setpiclength(int piclength)/设置图片的最大长度 this.piclength=piclength; public int getpiclength() return piclength; public boolean testlength()/判断图片的长度是否大于设定的最大长度 try in=new FileInputStream(picPath); if(in.available()/1024piclength) return false; catch(IOException e) System.out.pri

3、ntln(e.getMessage(); return true; public void setpictype(String pictype)/设置图片的扩展名 this.pictype=pictype; public boolean testpictype()/判断图片的扩展名是否是规定的 if(pictype!=null) for(int i=0;i pictype.length;i ) if(picPath.endsWith(pictype) 以下是在jsp页面中调用uploadpic 首先要引入此bean所在的包 jsp:useBean id=pic scope=page class

4、= /下一条语句是得到上一层页面,也就是用户提交的图片路径!String picp=codetostring.codeToString(request.getParameter(picPath); pic.setpicPath(picp); pic.setpiclength(100);/以kb为单位 if(pic.testlength() out.print(length ok ); else length ok String p1,p2; p1=.jpg; p2=.gif String type=p1,p2; pic.setpictype(type); if(pic.testpictype(

5、) typeoktype errormade by zonecens 不知道2楼的怎么样,我来学习一个!帮顶!好像XX一招很多 XX一下,找到相关网页约11,400,000篇,用时0.036秒 3000连个星星都升不了这个是JAVA代码 package ftp; import .ftp.*; .*; java.awt.*; java.awt.event.*; java.applet.*; java.io.*; class FTP extends Applet FtpClient aftp; DataOutputStream outputs; TelnetInputStream ins; Tel

6、netOutputStream outs; TextArea lsArea; Label LblPrompt; Button BtnConn; BtnClose; TextField TxtUID; TxtPWD; TxtHost; int ch; public String a = 没有连接主机 hostname void init() setBackground(Color.white); setLayout(new GridBagLayout(); GridBagConstraints GBC new GridBagConstraints(); LblPrompt Label( LblP

7、rompt.setAlignment(Label.LEFT); BtnConn Button(连接 BtnClose断开 BtnClose.enable(false); TxtUID TextField(, 15); TxtPWD TxtPWD.setEchoCharacter(* TxtHost 20); LblUIDUser ID: LblPWDPWD: LblHostHost: lsArea TextArea(30, 80); lsArea.setEditable(false); GBC.gridwidth GridBagConstraints.REMAINDER; GBC.fill G

8、ridBagConstraints.HORIZONTAL; ( (GridBagLayout) getLayout().setConstraints(LblPrompt, GBC); add(LblPrompt); 1; getLayout().setConstraints(LblHost, add(LblHost); getLayout().setConstraints(TxtHost, add(TxtHost); getLayout().setConstraints(LblUID, add(LblUID); getLayout().setConstraints(TxtUID, add(Tx

9、tUID); getLayout().setConstraints(LblPWD, add(LblPWD); getLayout().setConstraints(TxtPWD, add(TxtPWD); GBC.weightx 2; getLayout().setConstraints(BtnConn, add(BtnConn); getLayout().setConstraints(BtnClose, add(BtnClose); getLayout().setConstraints(lsArea, add(lsArea); boolean connect(String hostname,

10、 uid, pwd) this.hostname hostname; LblPrompt.setText(正在连接,请等待. try aftp FtpClient(hostname); aftp.login(uid, pwd); aftp.binary(); showFileContents(); catch (FtpLoginException e)无权限与主机: +连接! LblPrompt.setText(a); return false; (IOException连接主机:失败! (SecurityException成功! true; stop() aftp.closeServer()

11、; paint(Graphics g) action(Event evt, Object obj) if (evt.target = BtnConn) (connect(TxtHost.getText(), TxtUID.getText(), TxtPWD.getText() BtnConn.setEnabled(false); BtnClose.setEnabled(true); BtnClose) stop(); BtnConn.enable(true);与主机连接已断开! super.action(evt, obj); sendFile(String filepathname) resu

12、lt (aftp != null)正在粘贴文件,请耐心等待. contentperline;粘贴成功! fg String( index filepathname.lastIndexOf(fg); filename filepathname.substring(index 1); File localFile; localFile File(filepathname); RandomAccessFile sendFile RandomAccessFile(filepathname,r / sendFile.seek(0); outs aftp.put(filename); outputs DataOutputStream(outs); while (sendFile.getFilePointer() 0) buf.append( (char) ch); lsArea.appendText(buf.toString(); ins.close(); static main(String args) Frame f Frame(FTP Client f.addWindowListener(new WindowAdapter()

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1