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 경로 가져오기
가장 많이 본 글
-
http://blogs.technet.com/askperf/archive/2007/07/13/troubleshooting-a-windows-installer-issue.aspx Windows Installer(*.msi, MSIserver) 는 msi...
-
서버가 다음 오류 때문에 '\\10.0.1.100\WWW_ROOT' 디렉터리에 대한 '/ftp' 가상 루트를 추가하지 못했습니다(네트워크 BIOS 명령 한계에 도달했습니다. ). 데이터는 오류 코드입니다.
-
Microsoft SQL Server 관리 팩을 사용하면 기업 환경에서 SQL Server 2005 및 SQL Server 2000을 모니터링할 수 있습니다. 리소스 가용성과 구성 모니터링, 성능 데이터 수집 및 기본 임계값 테스트를 수행할 수 있도록...
댓글 없음:
댓글 쓰기