title: Invalid characters in a filename on Windows?
body: <p>As per the MSDN , the following characters cannot be part of the file name:</p>
  
  <blockquote>
    <p>Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:</p>
    
    <p>◦The following reserved characters:</p>
    
    <ul>
    <li><code>&lt;</code> (less than)</li>
    <li><code>&gt;</code> (greater than)</li>
    <li><code>:</code> (colon)</li>
    <li><code>"</code> (double quote)</li>
    <li><code>/</code> (forward slash)</li>
    <li><code>\</code> (backslash)</li>
    <li><code>|</code> (vertical bar or pipe)</li>
    <li><code>?</code> (question mark)</li>
    <li><code>*</code> (asterisk)</li>
    </ul>
  </blockquote>
  
  <p>In .net an api is provided to find the what are the characters not allowed in a filename</p>
  
  <pre><code>char[] invalidFileChars = Path.GetInvalidFileNameChars();
  </code></pre>
  
  <blockquote>
    <h2>Remarks</h2>
    
    <p>The array returned from this method is not guaranteed to contain the complete set of characters that are invalid in file and directory names. The full set of invalid characters can vary by file system. For example, on Windows-based desktop platforms, invalid path characters might include ASCII/Unicode characters 1 through 31, as well as quote ("), less than (&lt;), greater than (>), pipe (|), backspace (\b), null (\0) and tab (\t).</p>
  </blockquote>
  
  <p>But in the remark section it is said that it is depend on the file system. </p>
  
  <p>Is it safe to use this api for the windows based os like XP and windows 7?</p>