title: Cannot find txt file StreamReader
body: <p>'Unhandled Exception:</p>
  
  <p>System.IO.FileNotFoundException: Could not find file "/Logins.txt" occurred'</p>
  
  <p>Hi, newbie making a very basic login/signup system in xamarin c# that uses StreamReader from Systsem.IO to read a text file with stored usernames and passwords. The txt file is in the same directory as the .cs file itself and is visible in the solution explorer.
  I have tried putting in the full path with no success and ran as administrator just in case it was to do with permissions.
  Anything wrong?</p>
  
  <pre><code>public partial class LoginPage : ContentPage
  {
      public LoginPage()
      {
          InitializeComponent();
      }
      List&lt;string&gt; user = new List&lt;string&gt;();
      List&lt;string&gt; pass = new List&lt;string&gt;();
  
      public void btnLogin_Clicked(object sender, EventArgs e)
      {
          //Read the txt
          StreamReader sr = new StreamReader("Logins.txt");
          string line = "";
  
          //Read every line until there is nothing in the next line
          while ((line = sr.ReadLine()) != null)
          {
              //Grab items within new lines separated by a space and chuck them into their array
              string[] components = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
              user.Add(components[0]);
              pass.Add(components[0]);
          }
          //Check entries are on the same line and match
          if (user.Contains(txtUsername.Text) &amp;&amp; pass.Contains(txtPassword.Text) &amp;&amp; Array.IndexOf(user.ToArray(), txtUsername.Text) == Array.IndexOf(pass.ToArray(), txtPassword.Text))
          {
              Navigation.PushModalAsync(new HomeScreen());
          }
          else
              DisplayAlert("Error", "The username or password you have entered is incorrect", "Ok");
      }
      private void Cancel_Clicked(object sender, EventArgs e)
      {
          Navigation.PushModalAsync(new MainPage());
      }
  }
  </code></pre>