插件下载地址:http://ckeditor.com/download

1、CKeditor配置

在html页面的<head>标签中引入核心文件 ckeditor.js


<script src="ckeditor/ckeditor.js"></script>

2、在使用编辑器的地方插入HTML控件<textarea>

<form action="" method="post">
<p>
<textarea class="ckeditor" id="editor1" name="editor1" cols="100" rows="10" ></textarea>
</p>
</form>

注意:textare的class为 ckeditor。

3、将相应的控件替换成编辑器代码

4、配置编辑器

ckeditor的根目录下的config.js

a、工具栏的配置,可根据自己的需求增删。

 //工具栏
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
// { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
//{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'tools' },
//{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
//{ name: 'others' },
'/',
{ name: 'styles' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, //{ name: 'about' }
];

b、ckeditor上传图片

ckeditor的工具栏中虽然有插入图片的按钮,但是并没有实现上传图片,需要自定义实现

同样在config.js中设置

 config.image_previewText=' '; //预览区域显示内容

   config.filebrowserImageUploadUrl= "imageUpload";//要上传的action或servlet

这样就相当于在编辑器中有了一个用于上传图片的form表单,当然上传图片的操作需要自己实现,我这里用的是SpringMVC

工具类:

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.apache.commons.httpclient.util.DateUtil;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver; public class ImageUploadUtil {
// 图片类型
private static List<String> fileTypes = new ArrayList<String>();
private static String path="D:"; static {
fileTypes.add(".jpg");
fileTypes.add(".jpeg");
fileTypes.add(".bmp");
fileTypes.add(".gif");
fileTypes.add(".png");
} /**
* 图片上传
*
* @Title upload
* @param request
* @param DirectoryName
* 文件上传目录:比如upload(无需带前面的/) upload/news ..
* @return
* @throws IllegalStateException
* @throws IOException
*/
public static String upload(HttpServletRequest request, String DirectoryName) throws IllegalStateException,
IOException {
// 创建一个通用的多部分解析器
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getSession()
.getServletContext());
// 图片名称
String fileName = null;
// 判断 request 是否有文件上传,即多部分请求
if (multipartResolver.isMultipart(request)) {
// 转换成多部分request
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
// 取得request中的所有文件名
Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) {
// 记录上传过程起始时的时间,用来计算上传时间
// int pre = (int) System.currentTimeMillis();
// 取得上传文件
MultipartFile file = multiRequest.getFile(iter.next());
if (file != null) {
// 取得当前上传文件的文件名称
String myFileName = file.getOriginalFilename();
// 如果名称不为“”,说明该文件存在,否则说明该文件不存在
if (myFileName.trim() != "") {
// 获得图片的原始名称
String originalFilename = file.getOriginalFilename();
// 获得图片后缀名称,如果后缀不为图片格式,则不上传
String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")).toLowerCase();
if (!fileTypes.contains(suffix)) {
continue;
}
// 获得上传路径的绝对路径地址(/upload)-->
String realPath = request.getSession().getServletContext().getRealPath("/" + DirectoryName);
// String realPath=path+"/"+ DirectoryName;
System.out.println(realPath); // 如果路径不存在,则创建该路径
File realPathDirectory = new File(realPath);
if (realPathDirectory == null || !realPathDirectory.exists()) {
realPathDirectory.mkdirs();
}
// 重命名上传后的文件名 111112323.jpg
fileName=myFileName.substring(0, originalFilename.lastIndexOf("."))+(Math.random()*100) +suffix;
// fileName = DateUtil.format(new Date(), DateUtil.DATE_FORMAT_1) + suffix;
// 定义上传路径 .../upload/111112323.jpg
File uploadFile = new File(realPathDirectory + "\\" + fileName);
System.out.println(uploadFile);
file.transferTo(uploadFile);
}
}
// 记录上传该文件后的时间
// int finaltime = (int) System.currentTimeMillis();
// System.out.println(finaltime - pre);
}
}
return fileName;
} /**
* ckeditor文件上传功能,回调,传回图片路径,实现预览效果。
*
* @Title ckeditor
* @param request
* @param response
* @param DirectoryName
* 文件上传目录:比如upload(无需带前面的/) upload/..
* @throws IOException
*/
public static void ckeditor(HttpServletRequest request, HttpServletResponse response, String DirectoryName)
throws IOException {
String fileName = upload(request, DirectoryName);
// 结合ckeditor功能
// imageContextPath为图片在服务器地址,如upload/123.jpg,非绝对路径 String imageContextPath = request.getContextPath() + "/" + DirectoryName + "/" + fileName;
//String imageContextPath = path+"/"+ DirectoryName + "" + fileName;
System.out.println(imageContextPath);
response.setContentType("text/html;charset=UTF-8");
String callback = request.getParameter("CKEditorFuncNum");
PrintWriter out = response.getWriter();
out.println("<script type=\"text/javascript\">");
out.println("window.parent.CKEDITOR.tools.callFunction(" + callback + ",'" + imageContextPath + "',''" + ")");
out.println("</script>");
out.flush();
out.close();
} }

Controller:

@Path("/")
public class EditController { @Get("index")
@Post("index")
@AdminLoginRequired
public String bookindex(Invocation inv)
{
return "/views/common/edit/edit.vm";
} @Get("imageUpload")
@Post("imageUpload")
public void ImageUpload(HttpServletRequest request, HttpServletResponse response){
String DirectoryName = "upload/";
try {
ImageUploadUtil.ckeditor(request, response, DirectoryName);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} }

5、添加中文字体和字号

ckeditor默认的工具栏中是没有中文字体和字号的,需要自定义配置

a、下载中文字体包,链接:http://ckeditor.com/addons/plugins/all

将下载的文件解压放到ckeditor的根目录下,并且在config中进行如下配置:

 config.extraPlugins = 'font';
config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names; config.FontSizes = '初号/56px;小初/48px;一号/34px;32px/小一;29px/二号;24px/小二;21px/三号;20px/小三;18px/四号;16px/小四;14px/五号;12px/小五;10px/六号;小六/8px' ; //设置字体大小时 使用的式样

6、附config.js的配置参数详解

// 界面语言,默认为 'en'
config.language = 'zh-cn';   // 设置宽高
config.width = 400;
config.height = 400;   // 编辑器样式,有三种:'kama'(默认)、'office2003'、'v2'
config.skin = 'v2';   // 背景颜色
config.uiColor = '#FFF';   //工具栏(基础'Basic'、全能'Full'、自定义)plugins/toolbar/plugin.js
config.toolbar = 'Basic';
config.toolbar = 'Full'; 这将配合:
config.toolbar_Full = [
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select','Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor']
]; //工具栏是否可以被收缩
config.toolbarCanCollapse = true; //工具栏的位置
config.toolbarLocation ='top';//可选:bottom //工具栏默认是否展开
config.toolbarStartupExpanded = true;    // 取消 “拖拽以改变尺寸”功能 plugins/resize/plugin.js
config.resize_enabled = false; //改变大小的最大高度 config.resize_maxHeight = 3000; //改变大小的最大宽度
config.resize_maxWidth =3000; //改变大小的最小高度
config.resize_minHeight =250; //改变大小的最小宽度
config.resize_minWidth =750;
  // 当提交包含有此编辑器的表单时,是否自动更新元素内的数据
config.autoUpdateElement =true;   // 设置是使用绝对目录还是相对目录,为空为相对目录
config.baseHref = '' // 编辑器的z-index值
config.baseFloatZIndex = 10000; //设置快捷键
config.keystrokes = [
[CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ], //获取焦点
[CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ], //元素焦点 [ CKEDITOR.SHIFT + 121 /*F10*/,'contextMenu' ], //文本菜单 [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ], //撤销
[ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ], //重做
[CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ], // [ CKEDITOR.CTRL + 76 /*L*/, 'link' ], //链接 [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ], //粗体
[ CKEDITOR.CTRL + 73 /*I*/, 'italic' ], //斜体
[ CKEDITOR.CTRL + 85 /*U*/, 'underline' ], //下划线 [ CKEDITOR.ALT + 109 /*-*/,'toolbarCollapse' ]
] //设置快捷键 可能与浏览器快捷键冲突plugins/keystrokes/plugin.js.
config.blockedKeystrokes = [
CKEDITOR.CTRL + 66 /*B*/,
CKEDITOR.CTRL + 73 /*I*/,
CKEDITOR.CTRL + 85 /*U*/
] //设置编辑内元素的背景色的取值plugins/colorbutton/plugin.js.
config.colorButton_backStyle = {
element : 'span',
styles : { 'background-color' : '#(color)'}
} //设置前景色的取值 plugins/colorbutton/plugin.js
config.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520, 006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE, A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5, FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF’ //是否在选择颜色时显示“其它颜色”选项plugins/colorbutton/plugin.js
config.colorButton_enableMore =false //区块的前景色默认值设置 plugins/colorbutton/plugin.js
config.colorButton_foreStyle = {
element : 'span',
styles : { 'color' : '#(color)' }
}; //所需要添加的CSS文件 在此添加 可使用相对路径和网站的绝对路径
config.contentsCss = './contents.css'; //文字方向
config.contentsLangDirection ='rtl'; //从左到右 //CKeditor的配置文件 若不想配置 留空即可
CKEDITOR.replace( 'myfiled', { customConfig : './config.js' } ); //界面编辑框的背景色 plugins/dialog/plugin.js
config.dialog_backgroundCoverColor = '#fffefd'; //可设置参考
config.dialog_backgroundCoverColor = 'white' //默认 //背景的不透明度 数值应该在:0.0~1.0 之间plugins/dialog/plugin.js
config.dialog_backgroundCoverOpacity =0.5 //移动或者改变元素时 边框的吸附距离 单位:像素plugins/dialog/plugin.js
config.dialog_magnetDistance = 20; //是否拒绝本地拼写检查和提示 默认为拒绝 目前仅firefox和safari支持plugins/wysiwygarea/plugin.js.
config.disableNativeSpellChecker =true //进行表格编辑功能 如:添加行或列 目前仅firefox支持plugins/wysiwygarea/plugin.js
config.disableNativeTableHandles =true; //默认为不开启 //是否开启 图片和表格 的改变大小的功能config.disableObjectResizing = true;
config.disableObjectResizing= false //默认为开启 //设置HTML文档类型
config.docType ='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22' ; //是否对编辑区域进行渲染plugins/editingblock/plugin.js
config.editingBlock = true; //编辑器中回车产生的标签
config.enterMode =CKEDITOR.ENTER_P; //可选:CKEDITOR.ENTER_BR或CKEDITOR.ENTER_DIV //是否使用HTML实体进行输出 plugins/entities/plugin.js
config.entities = true; //定义更多的实体 plugins/entities/plugin.js
config.entities_additional = '#39'; //其中#代替了& //是否转换一些难以显示的字符为相应的HTML字符plugins/entities/plugin.js
config.entities_greek = true; //是否转换一些拉丁字符为HTMLplugins/entities/plugin.js
config.entities_latin = true; //是否转换一些特殊字符为ASCII字符 如"This is Chinese:汉语."转换为"This is Chinese: 汉语."plugins/entities/plugin.js
config.entities_processNumerical =false; //添加新组件
config.extraPlugins ='myplugin'; //非默认 仅示例 //使用搜索时的高亮色 plugins/find/plugin.js
config.find_highlight = {
element : 'span',
styles: { 'background-color' : '#ff0', 'color' : '#00f' }
}; //默认的字体名 plugins/font/plugin.js
config.font_defaultLabel = 'Arial'; //字体编辑时的字符集 可以添加常用的中文字符:宋体、楷体、黑体等plugins/font/plugin.js
config.font_names = 'Arial;Times NewRoman;Verdana'; //文字的默认式样 plugins/font/plugin.js
config.font_style = {
element : 'span',
styles : { 'font-family' : '#(family)' },
overrides : [ { element :'font', attributes : { 'face' : null } } ]
}; //字体默认大小 plugins/font/plugin.js
config.fontSize_defaultLabel = '12px'; //字体编辑时可选的字体大小 plugins/font/plugin.js
config.fontSize_sizes='8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px' //设置字体大小时 使用的式样 plugins/font/plugin.js
config.fontSize_style = {
element : 'span',
styles : { 'font-size' : '#(size)' },
overrides : [ {element : 'font', attributes : { 'size' : null } } ]
}; //是否强制复制来的内容去除格式plugins/pastetext/plugin.js
config.forcePasteAsPlainText =false//不去除 //是否强制用“&”来代替“&amp;”plugins/htmldataprocessor/plugin.js
config.forceSimpleAmpersand = false; //对address标签进行格式化 plugins/format/plugin.js
config.format_address = { element : 'address', attributes : { class :'styledAddress' } }; //对DIV标签自动进行格式化 plugins/format/plugin.js
config.format_div = { element : 'div', attributes : { class :'normalDiv' } }; //对H1标签自动进行格式化 plugins/format/plugin.js
config.format_h1 = { element : 'h1', attributes : { class :'contentTitle1' } }; //对H2标签自动进行格式化 plugins/format/plugin.js
config.format_h2 = { element : 'h2', attributes : { class :'contentTitle2' } }; //对H3标签自动进行格式化 plugins/format/plugin.js
config.format_h1 = { element : 'h3', attributes : { class :'contentTitle3' } }; //对H4标签自动进行格式化 plugins/format/plugin.js
config.format_h1 = { element : 'h4', attributes : { class :'contentTitle4' } }; //对H5标签自动进行格式化 plugins/format/plugin.js
config.format_h1 = { element : 'h5', attributes : { class :'contentTitle5' } }; //对H6标签自动进行格式化 plugins/format/plugin.js
config.format_h1 = { element : 'h6', attributes : { class :'contentTitle6' } }; //对P标签自动进行格式化 plugins/format/plugin.js
config.format_p = { element : 'p', attributes : { class : 'normalPara' }}; //对PRE标签自动进行格式化 plugins/format/plugin.js
config.format_pre = { element : 'pre', attributes : { class : 'code'} }; //用分号分隔的标签名字 在工具栏上显示plugins/format/plugin.js
config.format_tags ='p;h1;h2;h3;h4;h5;h6;pre;address;div'; //是否使用完整的html编辑模式如使用,其源码将包含:<html><body></body></html>等标签
config.fullPage = false; //是否忽略段落中的空字符 若不忽略 则字符将以“”表示plugins/wysiwygarea/plugin.js
config.ignoreEmptyParagraph = true; //在清除图片属性框中的链接属性时 是否同时清除两边的<a>标签plugins/image/plugin.js
config.image_removeLinkByEmptyURL = true; //一组用逗号分隔的标签名称,显示在左下角的层次嵌套中plugins/menu/plugin.js.
config.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'; //显示子菜单时的延迟,单位:ms plugins/menu/plugin.js
config.menu_subMenuDelay = 400; //当执行“新建”命令时,编辑器中的内容plugins/newpage/plugin.js
config.newpage_html = ''; //当从word里复制文字进来时,是否进行文字的格式化去除plugins/pastefromword/plugin.js
config.pasteFromWordIgnoreFontFace = true; //默认为忽略格式 //是否使用<h1><h2>等标签修饰或者代替从word文档中粘贴过来的内容plugins/pastefromword/plugin.js
config.pasteFromWordKeepsStructure = false; //从word中粘贴内容时是否移除格式plugins/pastefromword/plugin.js
config.pasteFromWordRemoveStyle =false; //对应后台语言的类型来对输出的HTML内容进行格式化,默认为空
config.protectedSource.push( /<"?["s"S]*?"?>/g ); // PHP Code
config.protectedSource.push( //g ); // ASP Code
config.protectedSource.push(/(]+>["s|"S]*?<"/asp:[^">]+>)|(]+"/>)/gi ); // ASP.NetCode //当输入:shift+Enter时插入的标签
config.shiftEnterMode = CKEDITOR.ENTER_P; //可选:CKEDITOR.ENTER_BR或CKEDITOR.ENTER_DIV //可选的表情替代字符 plugins/smiley/plugin.js.
config.smiley_descriptions = [
':)', ':(', ';)', ':D', ':/',':P',
'', '', '', '', '', '',
'', ';(', '', '','', '',
'', ':kiss', '' ]; //对应的表情图片 plugins/smiley/plugin.js
config.smiley_images = [
'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif',
'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif',
'devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif',
'broken_heart.gif','kiss.gif','envelope.gif']; //表情的地址 plugins/smiley/plugin.js
config.smiley_path = 'plugins/smiley/images/'; //页面载入时,编辑框是否立即获得焦点plugins/editingblock/plugin.js plugins/editingblock/plugin.js.
config.startupFocus = false; //载入时,以何种方式编辑 源码和所见即所得 "source"和"wysiwyg"plugins/editingblock/plugin.js.
config.startupMode ='wysiwyg'; //载入时,是否显示框体的边框plugins/showblocks/plugin.js
config.startupOutlineBlocks = false; //是否载入样式文件 plugins/stylescombo/plugin.js.
config.stylesCombo_stylesSet = 'default';
//以下为可选
config.stylesCombo_stylesSet = 'mystyles';
config.stylesCombo_stylesSet = 'mystyles:/editorstyles/styles.js';
config.stylesCombo_stylesSet ='mystyles:http://www.example.com/editorstyles/styles.js'; //起始的索引值
config.tabIndex = 0; //当用户键入TAB时,编辑器走过的空格数,(&nbsp;)当值为0时,焦点将移出编辑框 plugins/tab/plugin.js
config.tabSpaces = 0; //默认使用的模板 plugins/templates/plugin.js.
config.templates = 'default'; //用逗号分隔的模板文件plugins/templates/plugin.js.
config.templates_files = [ 'plugins/templates/templates/default.js' ] //当使用模板时,“编辑内容将被替换”框是否选中plugins/templates/plugin.js
config.templates_replaceContent =true; //主题
config.theme = 'default'; //撤销的记录步数 plugins/undo/plugin.js
config.undoStackSize =20; // 在 CKEditor 中集成 CKFinder,注意 ckfinder的路径选择要正确。
//CKFinder.SetupCKEditor(null, '/ckfinder/');

ckeditor插件的更多相关文章

  1. ruby -- 进阶学习(五)使用Ckeditor插件上传中文图片

    基于rails4.0环境 当使用Ckeditor上传中文命名图片时报错,解决方法是对图片进行重命名 在Ckeditor插件的安装目录下找到controllers/.../application.rb ...

  2. ckeditor 插件

    dialog 下面 建立一个 插件.js CKEDITOR.dialog.add("about", function (a) { var aaa = "<form& ...

  3. eclipse好玩的插件集(一) CKEditor插件

    啥也不说,先上效果图: 当你输入完图片的url时,你可以得到预览的图像,从而进行宽高调整! 使用方法: 在eclipse市场中搜索ckeditor 配置操作如下:   进行文件关联,这样就可以直接用c ...

  4. Angularjs中添加ckEditor插件

    使用方法看注释.主要解决帮上ngModel的问题 angular.module('newApp') .directive('ckeEditor', function() { return { /* F ...

  5. Jquery插件(CKEditor)

    描述 在html页面实现像word一样的编辑功能(可视化HTML编辑器) 解决方法 ckeditor插件官方网站 http://ckeditor.com/ 使用 1:去官方下载ckeditor插件,添 ...

  6. CKEditor在线编辑器增加一个自定义插件

    CKEditor是一个非常优秀的在线编辑器,它的前身就是FCKEditor,CKEditor据官方说是重写了内核的,但功能和性能比FCKEditor更为强大和优越.记得07年的时候第一次接触FCKEd ...

  7. CKEditor上传插件

    CKEditor上传插件 前言 CKEditor上传插件是不是免费的,与您分享在此开发.这个插件是基于ASP.NET MVC下开发的,假设是webform的用户或者其他语言的用户.能够參考把serve ...

  8. Extjs整合CKEditor富文本编辑器插件

    CKEditor插件官方下载地址: http://ckeditor.com/download/releases 我使用的版本是 ExtJS5.1.0  CKEditor4.4.8 参考文章: http ...

  9. CKEDITOR 4.6.X 版本 插件 弹出对话框 Dialog中 表格 Table 自定义样式Style 问题

    项目开发过程中,发现CKEDITOR 插件的弹出框 内 如果跟据项目需要写表格(table tr td),表格的边框等属性会被 CKEDITOR的清除或覆盖,导致表格很难看. 问题关键: 插件弹出框d ...

随机推荐

  1. iptables的扩展匹配

    iptables的匹配条件 一.通用匹配:-s.-d.-p.-i.-o 二.扩展匹配 1.隐含扩展:使用-p{tcp|udp|icmp}指定某特定协议后,自动能够对协议进行扩展 -p tcp --dp ...

  2. 【引】objective-c,6:Autorelease Pool

    参考博客: http://blog.leichunfeng.com/blog/2015/05/31/objective-c-autorelease-pool-implementation-princi ...

  3. eclipse连接mysql,插入数据时乱码

    问题:如果eclipse中项目的编码方式为utf-8 插入数据后,在数据库中查看后,汉字出现乱码情况 解决方法: 1.在获取连接的时候将conn = DriverManager.getConnecti ...

  4. About SQLite

    About SQLite See Also... Features When to use SQLite Frequently Asked Questions Well-known Users Boo ...

  5. CSS初体验

    经过学习,我对css有了初步的认识.css是层叠样式表(Cascading Style Sheets的缩写,它用于HTML元素的显示形式,是W3C推出的格式化的标准技术.CSS现在已经被大多数浏览器所 ...

  6. delegate用法

    一般来说 delegate 可以申明一个delegate类型  比如 public delegate funa(object b) 然后使用的时候申明 funa 作为类型  new funa(回调函数 ...

  7. Unity浅析

    在分析PRISM项目的时候, 发现里面用到了Unity 这个Component, 主要用于依赖注入的.由于对其不熟悉,索性分析了一下,记载在此,以作备忘. 任何事物的出现,总有它独特的原因,Unity ...

  8. 解除Team Foundation Server 5个用户的限制

    因为所有的用户必须加入到Team Foundation Licensed Users组内才能连接上TFS; 所以只要手工修改数据库,就可以破解5用户限制了.我们以TFSGuest4帐户做测试. 具体操 ...

  9. 在CentOS中将/var等已有目录挂载到新添加的硬盘

    1.查看当前硬盘使用状况: [root@gluster_node1 ~]# df -h Filesystem            Size  Used Avail Use% Mounted on / ...

  10. android的一些关键词