title: how to text post on reddit.com using c#
body: <p>i am using following code for text post in reddit.com but it gives bad captcha error,how can we get captcha and pass it in code. i am stuck there please help..</p>
  
  <pre><code> class Program
          {
              static void Main(string[] args)
              {
                  Reddit reddit = null;
                  var authenticated = false;
                  while (!authenticated)
                  {
                      Console.Write("OAuth? (y/n) [n]: ");
                      var oaChoice = Console.ReadLine();
                      if (!string.IsNullOrEmpty(oaChoice) &amp;&amp; oaChoice.ToLower()[0] == 'y')
                      {
                          Console.Write("OAuth token: ");
                          var token = "neud__ZOgyo52UsffzF0Z2WJnN0";
                          reddit = new Reddit("neud__ZOgyo52UsffzF0Z2WJnN0");//HsmHqXmvK3xciDt_FkPQJ-Klq-M
                          reddit.InitOrUpdateUser();
                          authenticated = reddit.User != null;
                          if (!authenticated)
                              Console.WriteLine("Invalid token");
                      }
                      else
                      {
                          Console.Write("Username: ");
                          var username = Console.ReadLine();
                          Console.Write("Password: ");
                          var password = ReadPassword();
                          try
                          {
                              Console.WriteLine("Logging in...");
                              reddit = new Reddit(username, password);
                              authenticated = reddit.User != null;
                          }
                          catch (AuthenticationException)
                          {
                              Console.WriteLine("Incorrect login.");
                              authenticated = false;
                          }
                      }
                  }
                  Console.Write("Create post? (y/n) [n]: ");
                  var choice = Console.ReadLine();
                  if (!string.IsNullOrEmpty(choice) &amp;&amp; choice.ToLower()[0] == 'y')
                  {
                      Console.Write("Type a subreddit name: ");
                      var subname = Console.ReadLine();
                      var sub = reddit.GetSubreddit("/r/subreddit");
                      Console.WriteLine("Making test post");
                      var post = sub.SubmitTextPost("RedditSharp test", "This is a test post sent from RedditSharp");
                      Console.WriteLine("Submitted: {0}", post.Url);
                  }
                  else
                  {
                      Console.Write("Type a subreddit name: ");
                      var subname = Console.ReadLine();
                      var sub = reddit.GetSubreddit("/r/subreddit");
                      foreach (var post in sub.GetTop(FromTime.Week).Take(10))
                          Console.WriteLine("\"{0}\" by {1}", post.Title, post.Author);
                  }
                  Console.ReadKey(true);
              }
  
              public static string ReadPassword()
              {
                  var passbits = new Stack&lt;string&gt;();
                  //keep reading
                  for (ConsoleKeyInfo cki = Console.ReadKey(true); cki.Key != ConsoleKey.Enter; cki = Console.ReadKey(true))
                  {
                      if (cki.Key == ConsoleKey.Backspace)
                      {
                          if (passbits.Count() &gt; 0)
                          {
                              Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                              Console.Write(" ");
                              Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                              passbits.Pop();
                          }
                      }
                      else
                      {
                          Console.Write("*");
                          passbits.Push(cki.KeyChar.ToString());
                      }
                  }
                  string[] pass = passbits.ToArray();
                  Array.Reverse(pass);
                  Console.Write(Environment.NewLine);
                  return string.Join(string.Empty, pass);
              }
          }
  </code></pre>
  
  <p>i am using this link "<a href="https://www.reddit.com/dev/api/" rel="nofollow">https://www.reddit.com/dev/api/</a>" for reference.plzz help</p>