Custom Search
Logiclabz
  • Home
  • C#
  • Convert byte[] to string in .Net C#

Convert byte[] to string in .Net C#

  

System.Net.WebClient webdata = new System.Net.WebClient();
string sampleurl = "http://www.sampleurl.com/default.htm";

//the below statement assigns byte[]
byte[] bytes = webdata.DownloadData(sampleurl);

//the below code converts byte[] type string type
string txt = System.Text.Encoding.GetEncoding("utf-8").GetString(bytes);



  


Leave a reply


Comments

  • algore says:
    Feb 21, 12

    some byte[] operations http://net-informations.com/vbprj/collections/collections-programs.htm ricd.



Do you like this post?