title: read file in c# .net
body: <p>i m developing an app in windows phone 7 in which i need to read a text file. i write a code for that but when i debug that code, it gives an error "method access exception".
  same code is working in c# windows form app. i dont know what is the problem. plz suggest me for this and solve this problem.
  my code is like this:</p>
  
  <pre><code>namespace fileread
  {
      public partial class MainPage : PhoneApplicationPage
      {
  
          private string line;
  
          // Constructor
          public MainPage()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, RoutedEventArgs e)
          {
              StreamReader sr = new StreamReader(@"D:\abc.txt");
              line = sr.ReadLine();
              MessageBox.Show(line);
          }
  </code></pre>
  
  <p>Error occured at line: "line = sr.ReadLine();"</p>