Thursday, September 17, 2009

C#: Read content as byte[] from an URL

public byte[] GetUrlResponse(string contentUrl)
{
WebClient request = new WebClient();
request.UseDefaultCredentials = true;
byte[] contentBytes = request.DownloadData(contentUrl);
return contentBytes;
}

No comments:

Post a Comment

Please use your common sense before making a comment, and I truly appreciate your constructive criticisms.