Home
> Uncategorized > Capture hi-res image from iTunes using C#
Capture hi-res image from iTunes using C#
This is a quick demo of how to use the iTunes API to extract the hi-res icon of any iOS app;
WebClient wc = new WebClient();
string strUrl = @”http://itunes.apple.com/search?term=” + HttpUtility.UrlEncode(tbSearch.Text) + “&entity=iPadSoftware”;
string strHtml = wc.DownloadString(strUrl);
const string strArtRegex = “artworkUrl100.:\”(.*?)\””;
Match mArt = Regex.Match(strHtml, strArtRegex);
string Url = mArt.Groups[1].Value;
imgArtwork.Src = Url;
This assumes a user interface somewhat like this:
<asp:TextBox runat=”server” ID=”tbSearch”></asp:TextBox>
<asp:Button runat=”server” ID=”btnSearch” OnClick=”btnSearchClick” Text=”Search”/>
<br/>
<img id=”imgArtwork” runat=”server”/>
Hope this helps someone.
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback