I am using a library that wants a photo in System.Data.Linq.Binary format. RIght now I only have a URL. what's the easiest way in C # to convert this link to System.Data.Linq.Binary format?
byte[] raw; using(var client = new WebClient()) { // in System.Net raw = client.DownloadData(url); } var binary = new Binary(raw); // in System.Data.Linq
I think WebClient.DownloadData is the easiest way:
WebClient.DownloadData
var webClient = new WebClient(); var imageBytes = webClient.DownloadData(yourUrl);
Source: https://habr.com/ru/post/1345069/More articles:"Error before before" error for getJSON call - jsonDeveloping with GAE - How Much Can I Depend On Google? - google-app-enginehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1345066/restrict-nth-child-results-to-visible-elements&usg=ALkJrhg5SDNhbbQuFi6C_jjKaTUfLvYlOQHow to fill text fields in gui application via command line? - pythonhow to enable curl in xampp - phpCouchDB read and write restrictions for _users database - couchdbHow to check from git - gitHow to get the same behavior as xsl: value-of select in the onclick hyperlink attribute? - xsltIncluding dependencies using @Autowired in objects created using "new ..." - javaWicket @SpringBean does not create serializable proxies - javaAll Articles