fckeditor官方有什么接口吗?
 我使用的是最新版本的FCKEDITOR。另外还有就是如果用正则的话该怎么判断?c#附带问各位一下,有什么好的垃圾文件处理机制给介绍下。比如我发表了一片文章  ,我删除的时候删除了数据库的信息,但是文章上传的一些图片还保存在服务器上,我想把这些图片一起删除有什么方法,,望高手赐教

解决方案 »

  1.   

    using System.IO;
    string strFilePath = Server.MapPath("newspicture\\"+图片名称);
    if(File.Exists(strFilePath))
    {
    File.Delete(strFilePath);//删除原来图片
    }
      

  2.   

    但是用1楼的方法要得到,图片的地址,
     所以我想看看有没有方法获取到FCKEDITOR中所有上传图片的地址
      

  3.   

    用正则表达式
      /// <summary>
            /// 删除内容中所有本地图片
            /// </summary>
            /// <param name="Content"></param>
            public static void DelContentPic(string Content)
            {
                string regex = @"<img[^src]*src=""[^http\://]*(?<picurl>[^""]*?)""";
                Regex r = new Regex(regex, RegexOptions.Compiled | RegexOptions.IgnoreCase);
                foreach (Match m in r.Matches(Content))
                {
                    string picurl=m.Groups["picurl"].ToString();
                    if (picurl.IndexOf(@"http://") == -1 && picurl != string.Empty)
                    { 
                        if(File.Exists(System.Web.HttpContext.Current.Server.MapPath(picurl)))
                        {
                            File.Delete(System.Web.HttpContext.Current.Server.MapPath(picurl));
                        }
                    }
                }
            }