IO(一)
文件相关
package com.bjsxt.io.file; import java.io.File; /**
* 两个常量
* 1、路径分隔符 ;
* 2、名称分隔符 /(windows) /(linux 等)
*
*
* @author Administrator
*
*/
public class Demo01 { /**
* @param args
*/
public static void main(String[] args) {
System.out.println(File.pathSeparator);
System.out.println(File.separator);
//路径表示形式
String path ="E:\\xp\\test\\2.jpg";
path="E:"+File.separator+"xp"+File.separator+"test"+File.separator+"2.jpg";
//推荐方式
path="E:/xp/test/2.jpg";
} }
package com.bjsxt.io.file; import java.io.File; /**
* 相对路径与绝对路径构造 File对象
* 1、相对路径
File(String parent, String child) ==>File("E:/xp/test","2.jpg")
File(File parent, String child) ==> File(new File("E:/xp/test"),"2.jpg")
2、绝对路径
File(String name);
* @author Administrator
*
*/
public class Demo02 { /**
* @param args
*/
public static void main(String[] args) {
String parentPath ="E:/xp/test";
String name ="2.jpg";
//相对路径
File src =new File(parentPath,name);
src =new File(new File(parentPath),name);
//输出
System.out.println(src.getName());
System.out.println(src.getPath());
//绝对路径
src =new File("E:/xp/test/2.jpg");
System.out.println(src.getName());
System.out.println(src.getPath());
//没有盘符: 以 user.dir构建
src =new File("test.txt");
src =new File(".");
System.out.println(src.getName());
System.out.println(src.getPath());
System.out.println(src.getAbsolutePath());
} }
package com.bjsxt.io.file; import java.io.File;
import java.io.IOException; import org.junit.Test; /**
* 常用方法:
1、文件名
getName() 文件名、路径名
getPath()路径名
getAbsoluteFile() 绝对路径所对应的File对象
getAbsolutePath() 绝对路径名
getParent() 父目录 ,相对路径的父目录,可能为null 如. 删除本身后的结果
2、判断信息
exists()
canWrite()
canRead()
isFile()
isDirectory()
isAbsolute():消除平台差异,ie以盘符开头,其他以/开头
3、长度 字节数 不能读取文件夹的长度
length()
4、创建、删除
createNewFile() 不存在创建新文件,存在返回false
delete() 删除文件
static createTempFile(前缀3个字节长,后缀默认.temp) 默认临时空间
staticcreateTempFile(前缀3个字节长,后缀默认.temp,目录)
deleteOnExit() 退出虚拟机删除,常用于删除临时文件 * @author Administrator
*
*/
public class Demo03 { /**
* @param args
*/
public static void main(String[] args) {
try {
test3();
} catch (IOException e) {
e.printStackTrace();
System.out.println("文件操作失败");
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} }
//创建删除文件
public static void test3() throws IOException, InterruptedException{
//createNewFile() 不存在创建新文件
//String path="E:/xp/test/con"; //con系统关键字
String path="E:/xp/test/200.jpg";
//String path="E:/xp/test/1.jpg";
File src =new File(path);
if(!src.exists()){
boolean flag =src.createNewFile();
System.out.println(flag?"成功":"失败");
} //删除文件
boolean flag =src.delete();
System.out.println(flag?"成功":"失败"); //static createTempFile(前缀3个字节长,后缀默认.temp) 默认临时空间
//static createTempFile(前缀3个字节长,后缀默认.temp,目录)
File temp= File.createTempFile("tes", ".temp",new File("e:/xp/test"));
Thread.sleep(10000);
temp.deleteOnExit(); //退出即删除 } //2、判断信息
//3、长度 length()
@Test
public void test2(){
//String path ="2.txt";
String path="E:/xp/test/200.jpg";
//String path="E:/xp/test/200.jpg";
File src =new File(path);
//是否存在
System.out.println("文件是否存在:"+src.exists());
//是否可读 写 canWrite() canRead()
System.out.println("文件是否可写"+src.canWrite());
System.out.println("============");
//isFile()
//isDirectory()
if(src.isFile()){
System.out.println("文件");
}else if(src.isDirectory()){
System.out.println("文件夹");
}else{
System.out.println("文件不存在");
} System.out.println("是否为绝对路径"+src.isAbsolute());
System.out.println("长度为:"+src.length()); }
//1、名称
@Test
public void test1(){
//File src =new File("E:/xp/test/2.jpg");
//建立联系
File src =new File("2.txt");
System.out.println(src.getName()); //返回名称
System.out.println(src.getPath()); //如果是绝对路径,返回完整路径,否则相对路径
System.out.println(src.getAbsolutePath());//返回绝对路径
System.out.println(src.getParent());//返回上一级目录,如果是相对,返回null
} }
package com.bjsxt.io.file; import java.io.File;
import java.io.FilenameFilter; /**
* 5、操作目录
mkdir() 创建目录,必须确保 父目录存在,如果不存在,创建失败
mkdirs() 创建目录,如果父目录链不存在一同创建
list() 文件|目录 名字符串形式
listFiles()
static listRoots() 根路径
* @author Administrator
*
*/
public class Demo04 { /**
* @param args
*/
public static void main(String[] args) {
String path ="E:/xp/test/";
File src =new File(path); //文件夹
if(src.isDirectory()){ //存在并且为目录
System.out.println("======子目录|文件名===");
String[] subNames =src.list(); for(String temp:subNames){
System.out.println(temp);
}
System.out.println("=====子目录|文件File对象====");
File[] subFiles =src.listFiles();
for(File temp:subFiles){
System.out.println(temp.getAbsolutePath());
}
System.out.println("=====子文件.java对象====");
//命令设计模式
subFiles =src.listFiles(new FilenameFilter(){ @Override
/**
* dir 代表src
*/
public boolean accept(File dir, String name) {
//System.out.println(dir.getAbsolutePath());
return new File(dir,name).isFile()&&name.endsWith(".java");
} });
for(File temp:subFiles){
System.out.println(temp.getAbsolutePath());
} }
}
public static void test1(){
String path ="E:/xp/test/parent/p/test";
File src =new File(path);
//src.mkdir();
src.mkdirs();
} }
package com.bjsxt.io.file; import java.io.File;
import java.io.FilenameFilter; /**
* 5、操作目录
mkdir() 创建目录,必须确保 父目录存在,如果不存在,创建失败
mkdirs() 创建目录,如果父目录链不存在一同创建
list() 文件|目录 名字符串形式
listFiles()
static listRoots() 根路径
* @author Administrator
*
*/
public class Demo04 { /**
* @param args
*/
public static void main(String[] args) {
String path ="E:/xp/test/";
File src =new File(path); //文件夹
if(src.isDirectory()){ //存在并且为目录
System.out.println("======子目录|文件名===");
String[] subNames =src.list(); for(String temp:subNames){
System.out.println(temp);
}
System.out.println("=====子目录|文件File对象====");
File[] subFiles =src.listFiles();
for(File temp:subFiles){
System.out.println(temp.getAbsolutePath());
}
System.out.println("=====子文件.java对象====");
//命令设计模式
subFiles =src.listFiles(new FilenameFilter(){ @Override
/**
* dir 代表src
*/
public boolean accept(File dir, String name) {
//System.out.println(dir.getAbsolutePath());
return new File(dir,name).isFile()&&name.endsWith(".java");
} });
for(File temp:subFiles){
System.out.println(temp.getAbsolutePath());
} }
}
public static void test1(){
String path ="E:/xp/test/parent/p/test";
File src =new File(path);
//src.mkdir();
src.mkdirs();
} }
package com.bjsxt.io.file; import java.io.File;
import java.util.Arrays; /**
* 输出子孙级目录|文件的名称(绝对路径)
* 1、listFiles()
* 2、递归
*
* static listRoots() 根路径
* @author Administrator
*
*/
public class Demo05 { /**
* @param args
*/
public static void main(String[] args) {
String path ="E:/xp/test";
File parent =new File(path);
//printName(parent); File[] roots =File.listRoots();
System.out.println(Arrays.toString(roots));
for(File temp:roots){
//printName(temp); }
}
/**
* 输出路径
*/
public static void printName(File src){
if(null==src || !src.exists()){
return ;
}
System.out.println(src.getAbsolutePath());
if(src.isDirectory()){ //文件夹
for(File sub:src.listFiles()){
printName(sub);
} }
} }
IO流:

package com.bjsxt.io.byteIO; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream; /**
* 文件的读取
* 1、建立联系 File对象
2、选择流 文件输入流 InputStream FileInputStream
3、操作 : byte[] car =new byte[1024]; +read+读取大小
输出
4、释放资源 :关闭
* @author Administrator
*
*/
public class Demo01 { /**
* @param args
*/
public static void main(String[] args) {
//1、建立联系 File对象
File src =new File("e:/xp/test/a.txt");
//2、选择流
InputStream is =null; //提升作用域
try {
is =new FileInputStream(src);
//3、操作 不断读取 缓冲数组
byte[] car =new byte[1024];
int len =0; //接收 实际读取大小
//循环读取
StringBuilder sb =new StringBuilder();
while(-1!=(len=is.read(car))){
//输出 字节数组转成字符串
String info =new String(car,0,len);
sb.append(info);
}
System.out.println(sb.toString()); } catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("文件不存在");
} catch (IOException e) {
e.printStackTrace();
System.out.println("读取文件失败");
}finally{
try {
//4、释放资源
if (null != is) {
is.close();
}
} catch (Exception e2) {
System.out.println("关闭文件输入流失败");
}
}
} }
package com.bjsxt.io.byteIO; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream; /**
* 写出文件
1、建立联系 File对象 目的地
2、选择流 文件输出流 OutputStream FileOutputStream
3、操作 : write() +flush
4、释放资源 :关闭
* @author Administrator
*
*/
public class Demo02 { /**
* @param args
*/
public static void main(String[] args) {
//1、建立联系 File对象 目的地
File dest =new File("e:/xp/test/test.txt");
//2、选择流 文件输出流 OutputStream FileOutputStream
OutputStream os =null;
//以追加形式 写出文件 必须为true 否则为覆盖
try {
os =new FileOutputStream(dest,true);
//3、操作
String str="bjsxt is very good \r\n";
//字符串转字节数组
byte[] data =str.getBytes();
os.write(data,0,data.length); os.flush(); //强制刷新出去
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("文件未找到");
} catch (IOException e) {
e.printStackTrace();
System.out.println("文件写出失败");
}finally{
//4、释放资源 :关闭
try {
if (null != os) {
os.close();
}
} catch (Exception e2) {
System.out.println("关闭输出流失败");
}
}
} }
package com.bjsxt.io.byteIO; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream; /**
1、建立联系 File对象 源头 目的地
2、选择流
文件输入流 InputStream FileInputStream
文件输出流 OutputStream FileOutputStream
3、操作 : 拷贝
byte[] flush =new byte[1024];
int len =0;
while(-1!=(len=输入流.read(flush))){
输出流.write(flush,0,len)
}
输出流.flush
4、释放资源 :关闭 两个流 * @author Administrator
*
*/
public class CopyFileDemo { /**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) {
String src ="E:/xp/test";
String dest="e:/xp/test/4.jpg";
try {
copyFile(src,dest);
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("文件不存在");
} catch (IOException e) {
e.printStackTrace();
System.out.println("拷贝文件失败|关闭流失败");
}
}
/**
* 文件的拷贝
* @param 源文件路径
* @param 目录文件路径
* @throws FileNotFoundException,IOException
* @return
*/
public static void copyFile(String srcPath,String destPath) throws FileNotFoundException,IOException {
//1、建立联系 源(存在且为文件) +目的地(文件可以不存在)
File src =new File(srcPath);
File dest =new File(destPath);
if(! src.isFile()){ //不是文件或者为null
System.out.println("只能拷贝文件");
throw new IOException("只能拷贝文件");
}
//2、选择流
InputStream is =new FileInputStream(src);
OutputStream os =new FileOutputStream(dest);
//3、文件拷贝 循环+读取+写出
byte[] flush =new byte[1024];
int len =0;
//读取
while(-1!=(len=is.read(flush))){
//写出
os.write(flush, 0, len);
}
os.flush(); //强制刷出 //关闭流
os.close();
is.close();
}
}
package com.bjsxt.io.byteIO; import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 文件操作
* 1、文件拷贝
* 2、文件夹拷贝 拒绝自己拷贝给自己
* @author Administrator
*
*/
public class FileUtil {
/**
* 拷贝文件夹
* @param src 源路径
* @param dest 目标路径
* @throws IOException
* @throws FileNotFoundException
*/
public static void copyDir(String srcPath,String destPath) throws FileNotFoundException, IOException{
//拒绝自己拷贝给自己
if(srcPath.equals(destPath)){
return ;
}
File src=new File(srcPath);
File dest =new File(destPath);
copyDir(src,dest);
} /**
* 拷贝文件夹
* @param src 源File对象
* @param dest 目标File对象
* @throws IOException
* @throws FileNotFoundException
*/
public static void copyDir(File src,File dest) throws FileNotFoundException, IOException{
if(src.isDirectory()){ //文件夹
dest =new File(dest,src.getName());
if(dest.getAbsolutePath().contains(src.getAbsolutePath())){
System.out.println("父目录不能拷贝到子目录中");
return;
}
}
copyDirDetail(src,dest);
} /**
* 拷贝文件夹细节
* @param src
* @param dest
*/
public static void copyDirDetail(File src,File dest) throws FileNotFoundException,IOException{
if(src.isFile()){ //文件
try {
FileUtil.copyFile(src, dest);
} catch (FileNotFoundException e) {
//e.printStackTrace();
throw e;
} catch (IOException e) {
//e.printStackTrace();
throw e;
}
}else if(src.isDirectory()){ //文件夹
//确保目标文件夹存在
dest.mkdirs();
//获取下一级目录|文件
for(File sub:src.listFiles()){
copyDirDetail(sub,new File(dest,sub.getName()));
}
}
} /**
* 文件的拷贝
* @param 源文件路径
* @param 目录文件路径
* @throws FileNotFoundException,IOException
* @return
*/
public static void copyFile(String srcPath,String destPath) throws FileNotFoundException,IOException {
//1、建立联系 源(存在且为文件) +目的地(文件可以不存在)
copyFile(new File(srcPath),new File(destPath));
}
/**
* 文件的拷贝
* @param 源文件File对象
* @param 目录文件File对象
* @throws FileNotFoundException,IOException
* @return
*/
public static void copyFile(File src,File dest) throws FileNotFoundException,IOException {
if(! src.isFile()){ //不是文件或者为null
System.out.println("只能拷贝文件");
throw new IOException("只能拷贝文件");
}
//dest为已经存在的文件夹,不能建立于文件夹同名的文件
if(dest.isDirectory()){
System.out.println(dest.getAbsolutePath()+"不能建立于文件夹同名的文件");
throw new IOException(dest.getAbsolutePath()+"不能建立于文件夹同名的文件");
} //2、选择流
InputStream is =new BufferedInputStream(new FileInputStream(src));
OutputStream os =new BufferedOutputStream(new FileOutputStream(dest));
//3、文件拷贝 循环+读取+写出
byte[] flush =new byte[1024];
int len =0;
//读取
while(-1!=(len=is.read(flush))){
//写出
os.write(flush, 0, len);
}
os.flush(); //强制刷出 //关闭流
os.close();
is.close();
}
}
package com.bjsxt.io.byteIO; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException; /**
* 文件夹的拷贝
* 1、文件 赋值 copyFile
* 2、文件 创建 mkdirs()
* 3、递归查找子孙级
*
* @author Administrator
*
*/
public class CopyDir { /**
* @param args
*/
public static void main(String[] args) {
//源目录
String srcPath="E:/xp/test/a";
//目标目录
String destPath="E:/xp/test/a/b";
try {
FileUtil.copyDir(srcPath,destPath);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} }
/**
* 拷贝文件夹
* @param src 源路径
* @param dest 目标路径
*/
public static void copyDir(String srcPath,String destPath){
File src=new File(srcPath);
File dest =new File(destPath);
copyDir(src,dest);
} /**
* 拷贝文件夹
* @param src 源File对象
* @param dest 目标File对象
*/
public static void copyDir(File src,File dest){
if(src.isDirectory()){ //文件夹
dest =new File(dest,src.getName());
}
copyDirDetail(src,dest);
} /**
* 拷贝文件夹细节
* @param src
* @param dest
*/
public static void copyDirDetail(File src,File dest){
if(src.isFile()){ //文件
try {
FileUtil.copyFile(src, dest);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}else if(src.isDirectory()){ //文件夹
//确保目标文件夹存在
dest.mkdirs();
//获取下一级目录|文件
for(File sub:src.listFiles()){
copyDirDetail(sub,new File(dest,sub.getName()));
}
}
} }
package com.bjsxt.io.charIO; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader; /**
* 纯文本读取
* @author Administrator
*
*/
public class Demo01 { /**
* @param args
*/
public static void main(String[] args) {
//创建源
File src =new File("E:/xp/test/a.txt");
//选择流
Reader reader =null;
try {
reader =new FileReader(src);
//读取操作
char[] flush =new char[1024];
int len =0;
while(-1!=(len=reader.read(flush))){
//字符数组转成 字符串
String str =new String(flush,0,len);
System.out.println(str);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("源文件不存在");
} catch (IOException e) {
e.printStackTrace();
System.out.println("文件读取失败");
}finally{
try {
if (null != reader) {
reader.close();
}
} catch (Exception e2) {
}
}
} }
package com.bjsxt.io.charIO; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer; /**
* 写出文件
* @author Administrator
*
*/
public class Demo02 { /**
* @param args
*/
public static void main(String[] args) {
//创建源
File dest =new File("e:/xp/test/char.txt");
//选择流
Writer wr =null;
try {
//追加文件,而不是覆盖文件
wr =new FileWriter(dest);
//写出
String msg ="追加.....锄禾日当午\r\n码农真辛苦\r\n一本小破书\r\n一读一上午";
wr.write(msg);
wr.append("倒萨发了看电视剧 "); wr.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}finally{
try {
if (null != wr) {
wr.close();
}
} catch (Exception e2) {
}
}
} }
package com.bjsxt.io.charIO; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer; /**
* 纯文本拷贝
* @author Administrator
*
*/
public class CopyFileDemo { /**
* @param args
*/
public static void main(String[] args) {
//创建源 仅限于 字符的纯文本
File src =new File("E:/xp/test/Demo03.java");
File dest =new File("e:/xp/test/char.txt");
//选择流
Reader reader =null;
Writer wr =null;
try {
reader =new FileReader(src);
wr =new FileWriter(dest);
//读取操作
char[] flush =new char[1024];
int len =0;
while(-1!=(len=reader.read(flush))){
wr.write(flush, 0, len);
}
wr.flush();//强制刷出
} catch (FileNotFoundException e) {
e.printStackTrace();
System.out.println("源文件不存在");
} catch (IOException e) {
e.printStackTrace();
System.out.println("文件读取失败");
}finally{
try {
if (null != wr) {
wr.close();
}
} catch (Exception e2) {
}
try {
if (null != reader) {
reader.close();
}
} catch (Exception e2) {
}
} } }
IO(一)的更多相关文章
- VS2015编译GEOS
下载链接:http://trac.osgeo.org/geos/ 1. 打开cmake,加载geos源码和定位geos的工程存放位置: 2.点击configure,会报错,首先设置CMAKE_INST ...
- 高性能IO模型浅析
高性能IO模型浅析 服务器端编程经常需要构造高性能的IO模型,常见的IO模型有四种: (1)同步阻塞IO(Blocking IO):即传统的IO模型. (2)同步非阻塞IO(Non-blocking ...
- 深究标准IO的缓存
前言 在最近看了APUE的标准IO部分之后感觉对标准IO的缓存太模糊,没有搞明白,APUE中关于缓存的部分一笔带过,没有深究缓存的实现原理,这样一本被吹上天的书为什么不讲透彻呢?今天早上爬起来赶紧找了 ...
- [APUE]标准IO库(下)
一.标准IO的效率 对比以下四个程序的用户CPU.系统CPU与时钟时间对比 程序1:系统IO 程序2:标准IO getc版本 程序3:标准IO fgets版本 结果: [注:该表截取自APUE,上表中 ...
- [APUE]标准IO库(上)
一.流和FILE对象 系统IO都是针对文件描述符,当打开一个文件时,即返回一个文件描述符,然后用该文件描述符来进行下面的操作,而对于标准IO库,它们的操作则是围绕流(stream)进行的. 当打开一个 ...
- [.NET] 利用 async & await 进行异步 IO 操作
利用 async & await 进行异步 IO 操作 [博主]反骨仔 [出处]http://www.cnblogs.com/liqingwen/p/6082673.html 序 上次,博主 ...
- [原] KVM 虚拟化原理探究(6)— 块设备IO虚拟化
KVM 虚拟化原理探究(6)- 块设备IO虚拟化 标签(空格分隔): KVM [toc] 块设备IO虚拟化简介 上一篇文章讲到了网络IO虚拟化,作为另外一个重要的虚拟化资源,块设备IO的虚拟化也是同样 ...
- [原] KVM 虚拟化原理探究(5)— 网络IO虚拟化
KVM 虚拟化原理探究(5)- 网络IO虚拟化 标签(空格分隔): KVM IO 虚拟化简介 前面的文章介绍了KVM的启动过程,CPU虚拟化,内存虚拟化原理.作为一个完整的风诺依曼计算机系统,必然有输 ...
- Performance Monitor4:监控SQL Server的IO性能
SQL Server的IO性能受到物理Disk的IO延迟和SQL Server内部执行的IO操作的影响.在监控Disk性能时,最主要的度量值(metric)是IO延迟,IO延迟是指从Applicati ...
- java.IO输入输出流:过滤流:buffer流和data流
java.io使用了适配器模式装饰模式等设计模式来解决字符流的套接和输入输出问题. 字节流只能一次处理一个字节,为了更方便的操作数据,便加入了套接流. 问题引入:缓冲流为什么比普通的文件字节流效率高? ...
随机推荐
- 版本控制 - SVN/TortoiseSVN
研读了blog: 1. http://www.open-open.com/lib/view/open1346982569725.html 2. http://www.360doc.com/conte ...
- ```````````````辐射度 Radiometry
solid angel --立体角 单位 sr 球面度 dω就是对solid angel的微分 4π代表一个球 我发现dω就是对半径为1的球的表面积的微分 所以4π代表一个球 这就是球的表面积.. ...
- AVRStudio 的编译优化级别
-00 无优化. -01 减少代码尺寸和执行时间,不进行需要大量编译时间的优化. -02 几乎执行所有优化,而不考虑代码尺寸和执行时间. -03 执行 -02 所有的优化,以及内联函数,重命名寄存器的 ...
- Spring中自动装配(转)
Spring中有四种自动装配类型,分别为:byName,byType,constructor,autodetect,下面来分别介绍一下这些是如何自动装配的 <bean id="foo& ...
- CKEditor (Toolbar Definition)工具栏自定义配置
JS是大小写敏感的, 在设置配置文件的时候需要注意 以CKEditor 4为基础我们可以通过两种方式配置CKEditor的工具栏,一种是是通过config.js配置文件设置, 另一种是IN-PAGE方 ...
- 13test06:花朵数
#include<iostream> using namespace std; #define N a//定义宏时后面不加:否则会把':'一起定义为宏. int getP(int,int) ...
- 自绘按钮,添加Color属性(转载)
在标准的Windows程序中所有按钮均没有颜色.因此Delphi提供的所有按钮组件也均无颜色属性,有时你可能做了一个五颜六色的程序界面,而按钮颜色可能很不相称. 在此本人提供一种用自定义组件制作有颜色 ...
- zoj 2358,poj 1775 Sum of Factorials(数学题)
题目poj 题目zoj //我感觉是题目表述不确切,比如他没规定xi能不能重复,比如都用1,那么除了0,都是YES了 //算了,这种题目,百度来的过程,多看看记住就好 //题目意思:判断一个非负整数n ...
- POJ 2591 1338 2545 2247(数列递归衍生问题,思路挺妙)
四道题的难度: 2591<1338<2545<2247 POJ 2591 Set Definition: 这是从discuss里看来的,写的挺好,直接copy,根据我的代码稍有改动( ...
- ios滤镜
现在很多滤镜效果都写好了,搬运工的我直接拿来用(感谢