现在的位置: 首页 > 综合 > 正文

获取FCK网络编辑器里的图片路径

2013年03月14日 ⁄ 综合 ⁄ 共 607字 ⁄ 字号 评论关闭
 string page = "<input type=/"image/" height=/"325/" width=/"500/" src=/"FCKeditor/editor/filemanager/connectors/aspx/userfiles/image/B011627669461283B6A55B8611153813.jpg/" />";
           
string pattern = "<input type=/"image/" //s+src=/"(?<src>[^/"]+?)/"[//s//S]*?>";

            Regex _r = new Regex(pattern, RegexOptions.Compiled);
            MatchCollection _m
= _r.Matches(page);
           
string[] result = new string[_m.Count];
           
for (int i = 0; i < _m.Count; i++)
            {
                result[i]
= _m[i].Groups["src"].Value;
               
                Console.WriteLine(result[i]);
            }

            Console.ReadLine();

抱歉!评论已关闭.