Я хотел бы узнать, как получить исходный код страницы с помощью веб-клиента vb.net для Windows Phone 7.
Я нашел пример на C #, но мне нужен пример на vb.net.
Спасибо!
C # (код, который я нашел в интернете)
public void GetFeed()
{
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri("http://www.slpg.org/syndication.axd"));
}
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string data = e.Result;
// do something with the feed here
}
VB.Net (вывод с C # на VB-сайт)
Public Sub GetFeed()
Dim client As New WebClient()
client.DownloadStringCompleted += New DownloadStringCompletedEventHandler(AddressOf client_DownloadStringCompleted)
client.DownloadStringAsync(New Uri("http://www.slpg.org/syndication.axd"))
End Sub
Private Sub client_DownloadStringCompleted(sender As Object, e As DownloadStringCompletedEventArgs)
Dim data As String = e.Result
' do something with the feed here
End Sub