准备工作

百度编辑器官方下载并将文件放到项目根目录下

因为vs2008 只到Framework 3.5,所以需要将4.0的东西去掉。

1)下载.net framework 3.5版的 Newtonsoft.Json.dll 替换掉 /net/bin 中的。

2)删除 net 文件下 config.cs 里的 using System.Dynamic,因为3.5版本没有这个。

3)查找替换,用 string.IsNullOrEmpty 替换 String.IsNullOrWhiteSpace。

4)去掉 config.json 里的解释,不然上传图片功能用不了。(下面的可以直接拿去用,里面修改了图片显示的地址,"imageUrlPrefix": "" 原文是这样:"imageUrlPrefix": "/ueditor/net/", /* 图片访问路径前缀 */)

{
    
    "imageActionName": "uploadimage", 
    "imageFieldName": "upfile",
    "imageMaxSize": 2048000, 
    "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], 
    "imageCompressEnable": true, 
    "imageCompressBorder": 1600,
    "imageInsertAlign": "none",
    "imageUrlPrefix": "",
    "imagePathFormat": "/UeEditor/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", 

 
    "scrawlActionName": "uploadscrawl",
    "scrawlFieldName": "upfile",
    "scrawlPathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", 
    "scrawlMaxSize": 2048000,
    "scrawlUrlPrefix": "/ueditor/net/", 
    "scrawlInsertAlign": "none",


    "snapscreenActionName": "uploadimage", 
    "snapscreenPathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", 
    "snapscreenUrlPrefix": "/ueditor/net/", 
    "snapscreenInsertAlign": "none", 

   
    "catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
    "catcherActionName": "catchimage", 
    "catcherFieldName": "source", 
    "catcherPathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
    "catcherUrlPrefix": "/ueditor/net/",
    "catcherMaxSize": 2048000,
    "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], 

    
    "videoActionName": "uploadvideo", 
    "videoFieldName": "upfile", 
    "videoPathFormat": "upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",
    "videoUrlPrefix": "/ueditor/net/", 
    "videoMaxSize": 102400000, 
    "videoAllowFiles": [
        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"],


    "fileActionName": "uploadfile", 
    "fileFieldName": "upfile", 
    "filePathFormat": "upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", 
    "fileUrlPrefix": "/ueditor/net/", 
    "fileMaxSize": 51200000,
    "fileAllowFiles": [
        ".png", ".jpg", ".jpeg", ".gif", ".bmp",
        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
        ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
        ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
    ], 

   
    "imageManagerActionName": "listimage",
    "imageManagerListPath": "upload/image",
    "imageManagerListSize": 20, 
    "imageManagerUrlPrefix": "/ueditor/net/",
    "imageManagerInsertAlign": "none", 
    "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],

   
    "fileManagerActionName": "listfile", 
    "fileManagerListPath": "upload/file", 
    "fileManagerUrlPrefix": "/ueditor/net/", 
    "fileManagerListSize": 20, 
    "fileManagerAllowFiles": [
        ".png", ".jpg", ".jpeg", ".gif", ".bmp",
        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
        ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
        ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
    ] 

}
去掉注释后的config.json

相关文章: