title: string filter: detect non-ASCII signs
body: <p>I am creating an application which will send the input string to mobile device. Some devices have problems with encoding special characters so I would like to create a filter which doesn't allow the user on PC to enter special characters.</p>
  
  <p>The application is written in C# (.NET 3.5) and I would like to attach a method to key press event. The pseudocode is the following:</p>
  
  <pre><code>private void checkTextBoxContent(TextBox txtEntry)
  {
      if(txtEntry.Text contains non-ASCII sign)
      {
          show messageBox;
          remove the last entered character;
      }
  }
  </code></pre>
  
  <p>Does anyone know if there is any existing method that detects ASCII/non-ASCII sign so that could be used in condition </p>
  
  <blockquote>
    <p>txtEntry.Text contains non-ASCII sign?</p>
  </blockquote>
  
  <p>Thank you!</p>