<NOSPAMJ3033@Hotmail.com> wrote:
>"dgk" <NoWhere@MailsAnonymous.com> wrote in message
>news:egn542hjnqh0alketta74v8boahe8aemph@4ax.com...
>> On Sun, 16 Apr 2006 16:05:34 -0700, "Jim Hughes"
>> <NOSPAMJ3033@Hotmail.com> wrote:
>>
>>>.NET Framework Class Library
>>>Path.GetInvalidFileNameChars Method
>>>Note: This method is new in the .NET Framework version 2.0.
>>>
>>>
http://msdn2.microsoft.com/en-us/library/system.io.path.getinvalidfilenamechars(VS.80).aspx
>>>
>>>
>>
>> Thanks, that makes things easier. But all it returns is "<>| those are
>> the only invalid file characters? / and \ should be illegal. What
>> about ? and *
>>
>> #%~`
>>
>> Well, I guess that they're legal.
>
>
>If all you did is a System.IO.Path.GetInvalidFileNameChars().ToString(), I
>can see how you might think that.
>
>However, there are 41 separate characters in that list on my system.
>
>"
><
>>
>|
>(additional unprintable characters stripped by me from reply):
>:
>*
>?
>\
>/
>
> static void test()
> {
> char[] ch = System.IO.Path.GetInvalidFileNameChars();
> System.Diagnostics.Trace.WriteLine(ch.Length);
> for (int i = 0; i < ch.Length; i++)
> {
> // dump hex values for each char
> //System.Diagnostics.Trace.WriteLine(Convert.ToByte(ch[i]).ToString("X"));
> System.Diagnostics.Trace.WriteLine(ch[i]);
> }
> }
>
>From the link I sent:
>
>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).
>
>
>
visualizer, which is bad form on my part. The length was 41 or so
however. Odd that many of the printable characters didn't show. I
guess because the unprintable ones were messing it up. Text Visualizer