title: C#, Skipping Console.ReadLine(); Console.Read(); while in loop
body: <p>If I run my code and insert correct value first time program works fine and does its job, but if I input wrong path and allow for loop to spin second time it skips <code>path=Console.ReadLine();</code> but it does not skip <code>j = (char)Console.Read();</code> same thing persist through out the remaining code.</p>
  
  <pre><code>do
  {
      Console.WriteLine("Insert path:");
      path = Console.ReadLine();
  
      temp1 = CheckPath(path); //checks if inserted value is legit
      if (temp1 == false) 
      { 
          Console.WriteLine("\nDo you want to skip this step(by default directory will be set to Desktop)? Y/N ");
          j = (char)Console.Read(); 
          if (j.Equals('Y') || j.Equals('y')) 
          {
              path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); 
              temp1 = true; 
          }
      }
      //User inputs y/Y loop will end and exit with either path chosen by user or with desktop path
  } while (!temp1);
  </code></pre>
  
  <p><code>path = Console.ReadLine();</code> is being skipped if user fails to insert correct path. Been looking for the solution since yesterday and I have failed to find identical problem on the web. Link to full code: <a href="http://www.sourcepod.com/ljovzq97-49064" rel="nofollow">Code.</a></p>