I am working on an App for Windows Mobile. Currently I am trying to get the HTML Source code from a webpage with Windows 1252 Encoding. While running the code below I'm always getting a "System.NotSupportedException". Can anybody help me?
The place it gets called:
private async void b_day1_Click(object sender, RoutedEventArgs e)
{
int day = 1;
await GetHTML(day);
}
The method "GetHTML(int day)":
public async System.Threading.Tasks.Task<string> GetHTML(int day)
{
var client = new HttpClient();
HttpResponseMessage response;
if (day == 1)
{
response = await client.GetAsync("http://www.fsglb.de/fileadmin/stundenplaene/vplan/1.htm");
var bytearray = await response.Content.ReadAsByteArrayAsync();
string final = Encoding.GetEncoding(1252).GetString(bytearray);
Debug.WriteLine(final);
return final;
}
}
var encoding = Encoding.GetEncoding(1252); string final = encoding.GetString(bytearray);