Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:29:35+00:00 2026-06-08T18:29:35+00:00

As per the MSDN , the following characters cannot be part of the file

  • 0

As per the MSDN , the following characters cannot be part of the file name:

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:

◦The following reserved characters:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

In .net an api is provided to find the what are the characters not allowed in a filename

char[] invalidFileChars = Path.GetInvalidFileNameChars();

Remarks

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 (<), greater than (>), pipe (|), backspace (\b), null (\0) and tab (\t).

But in the remark section it is said that it is depend on the file system.

Is it safe to use this api for the windows based os like XP and windows 7?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:29:37+00:00Added an answer on June 8, 2026 at 6:29 pm

    Yes, in an ASCII-based file system Path.GetInvalidFileNameChars() will guarantee you a safe file name. If you check the ASCII chart here you will find that everything from the left column is excluded and certain characters from the remaining columns are also excluded. Check the decimal representation of each char in the returned array for a full list of what’s excluded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per this MSDN article: W3C Extended Log File Format (IIS 6.0) It says
Per the code below, I am getting the following message. I am fairly certain
As per [http://lessons.goxtk.com/09/][1] [1]: http://lessons.goxtk.com/09/ i need to use a .vtk file with 15,000
Per the MSDN documentation , the following syntax is used: // A read-write instance
I want to use wcf performance counters per operation , like here: http://msdn.microsoft.com/en-us/library/ms731052(v=vs.90).aspx how
I use the following code in a asp.net website. On application init i call
As per the following article, I have defined my service contract as http://blogs.msdn.com/b/endpoint/archive/2010/11/13/simplified-asynchronous-programming-model-in-wcf-with-async-await.aspx [ServiceContract]
Per MSDN , In SQL Server, the page size is 8 KB. This means
Per MSDN URLEncode converts characters as follows: Spaces ( ) are converted to plus
The following attempt works in IE8 but not in Firefox (cannot use JQuery for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.