public void getImgs(string _html) { Regex rxImages = new Regex("<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase & RegexOptions.IgnorePatternWhitespace); MatchCollection mc = rxImages.Matches(_html); foreach(Match m in mc) { Console.WriteLine(m.Groups[0].Value); Console.WriteLine(m.Groups[1].Value); } } result: 0: < img src = "http://yeonpil.org/소녀시대.jpg" / > 1: http: //yeonpil.org/소녀시대.jpg
2012/07/11
c#, html 에서 img src 경로 가져오기
가장 많이 본 글
-
SQL Server 2000/2005: Automated Database Backups and Restorations http://www.codeproject.com/KB/database/assiduous.aspx Enterprise Manager 나...
-
금일자 Zdnet 기사에 흥미로운게 하나 올라와 있네요.^^;; 새로운 OS 를 개발하고 있다는 얘기는 본적이 있는데 말이지요.. "Singularity는 차기 윈도우와는 상관이 없다" "OS와 애플리케이션간 정보 교환 방...
-
http://www.httpwatch.com/ 여러 웹사이트 디버깅 툴들이 있지만, HttpWatch 도 그중에 하나이지만 꾀 훌륭한 툴 입니다. 서버 운영자에게는 그닥 필요가 없을것 같습니다만, 역시 웹개발자나 디자이너에게는 제 역할을 할것 같습니다...
댓글 없음:
댓글 쓰기