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 경로 가져오기
가장 많이 본 글
-
Microsoft iSCSI Software Target 서비스가 네트워크 주소 10.0.1.152, 포트 3260에 바인딩하지 못했습니다. 작업에 실패했습니다. 오류 코드: 10049. 이 포트를 사용하고 있는 다른 응용 프로그램 없는지 확인하십시오.
-
■ 요약 Microsoft .NET Framework SDK(Software Development Kit)나 Visual Studio .NET을 설치한 후에 IIS(Internet Information Server) 매핑이 이루어져 ASP.NET ...
-
Windows 라이센스가 시스템 오류에 의해 복구되었습니다. 사용자의 Windows에 대한 정품 인증을 다시 받아야 합니다.
댓글 없음:
댓글 쓰기