using System; using System.Collections.Generic; using System.Linq; //using System.Xml.Linq; using System.IO; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace SilverlightApplication { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { WebClient veebiklient = new WebClient(); veebiklient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(veebiklient_DownloadStringCompleted); veebiklient.DownloadStringAsync(new Uri("http://localhost:49473/baasilehesti/leht1.aspx")); MessageBox.Show("avab"); /* StreamReader sisse = new StreamReader(veebiklient.DownloadStringAsync for (string rida = sisse.ReadLine(); rida != null; rida = sisse.ReadLine()) { Console.WriteLine(rida); } sisse.Close();*/ } void veebiklient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { MessageBox.Show("kohal "+e.Result); textBox1.Text = e.Result+" valmis"; //throw new NotImplementedException(); } } }