attachment.java
来自「cwbbs 云网论坛源码」· Java 代码 · 共 53 行
JAVA
53 行
package cn.js.fan.mail;import javax.mail.*;import javax.mail.internet.*;import cn.js.fan.util.*;import java.io.InputStream;public class Attachment { String name = ""; int size = 0; int num = 0; Part part; String ext = ""; public Attachment(Part part, int num) { this.part = part; try { name = StrUtil.UnicodeToGB(part.getFileName()); if (name!=null) ext = name.substring(name.length() - 3, name.length()).toLowerCase(); else ext = ""; size = part.getSize(); } catch (Exception e) { System.out.println("Attachment:"+e.getMessage()); } this.num = num; } public String getName() { return name; } public String getExt() { return ext; } public int getSize() { return size; } public int getNum() { return num; } public InputStream getInputStream() throws Exception { return part.getInputStream(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?