Re: searching for the highest index within a directory

From: Ada (Ada_at_discussions.microsoft.com)
Date: 03/03/05


Date: Thu, 3 Mar 2005 02:29:01 -0800

Cor, thanks for the snippet.
according to your snippet, doesn't it create an array for all the files
inside that directory and not just the "testFile_xx"?

Nick, to answer your question....
it's a small exercise for myself. :-)
an application for this type of naming is a sequential graphic animation
files.
i'm doing this to avoid overwriting the existing file and resume sequence
from the highest index file.

can you elaborate why
      testFile_4
comes after
      testFile_34?

"Cor Ligthert" wrote:

> Ada,
>
> You mean something as this?
>
> \\\
> DirectoryInfo di = new DirectoryInfo(@"c:\");
> FileSystemInfo[] dirs = di.GetFiles();
> string[] str = new string[dirs.Length];
> for (int i = 0;i < dirs.Length;i++)
> {str[i] = dirs[i].Name;}
> Array.Sort(str);
> MessageBox.Show(str[str.Length-1]);
> ///
>
> I hope this helps?
>
> Cor
>
>
>



Relevant Pages

  • Re: How do I get the user name in my VB.NET program?
    ... In article, Cor Ligthert wrote: ... > You can use WMI, however in my opinion is this snippet simpler for your ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Easy label question...
    ... I see it upi only setting to false in this snippet. ... Cor ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Frames show and hide?
    ... When it is about Iframes I am curious how you did what you wrote, ... show a little snippet? ... Cor ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: SmtpMail causes application to hang...
    ... This snippet you show now in this newsgroup has been here often. ... Mostly is the error that the smtp mailserver is not correct. ... Cor ...
    (microsoft.public.dotnet.languages.vb)