Click here to Skip to main content
15,880,543 members
Home / Discussions / C#
   

C#

 
QuestionRe: How to check if extensions follows up in a list? Pin
Goobashi11-Mar-09 23:39
Goobashi11-Mar-09 23:39 
AnswerRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:11
professional dan!sh 12-Mar-09 0:11 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:20
Matjaz-xyz12-Mar-09 0:20 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:26
professional dan!sh 12-Mar-09 0:26 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:36
Matjaz-xyz12-Mar-09 0:36 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 1:44
Matjaz-xyz12-Mar-09 1:44 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 2:21
professional dan!sh 12-Mar-09 2:21 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:33
sitebuilderLuc Pattyn12-Mar-09 3:33 
In today's pseudo-language that would be:

filelist=getAllFilenames()
filelist.Sort
diff=0
foreach(file in filelist) {
  if (jpg) diff++
  else diff--
  if (diff<-1 or diff>1) error
}


Two remarks:

1. to get a natural sort order for the file names, same as Windows Explorer does, you would need to use Explorer's code, i.e. use P/Invoke and the prototype:
[DllImport("shlwapi.dll", CharSet=CharSet.Unicode, ExactSpelling=true)]
private static extern int StrCmpLogicalW(string s1, string s2);

Of course if the name part is just a number, you could use int.Parse and sort based on the outcome.

2. I cannot imagine where and how your requirement could ever have a useful application.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


AnswerRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:14
professional Xmen Real 12-Mar-09 0:14 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:22
Matjaz-xyz12-Mar-09 0:22 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:27
professional Xmen Real 12-Mar-09 0:27 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:30
Matjaz-xyz12-Mar-09 0:30 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:33
professional dan!sh 12-Mar-09 0:33 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:35
Matjaz-xyz12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:35
professional Xmen Real 12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:44
sitebuilderLuc Pattyn12-Mar-09 3:44 
QuestionWIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:22
Goobashi11-Mar-09 23:22 
AnswerRe: WIN directory to DOS directory question Pin
musefan11-Mar-09 23:44
musefan11-Mar-09 23:44 
GeneralRe: WIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:56
Goobashi11-Mar-09 23:56 
AnswerRe: WIN directory to DOS directory question Pin
Matjaz-xyz12-Mar-09 1:00
Matjaz-xyz12-Mar-09 1:00 
AnswerRe: WIN directory to DOS directory question Pin
0x3c012-Mar-09 1:44
0x3c012-Mar-09 1:44 
QuestionHow to run an expression which is in string format? Pin
RezaAsAdi11-Mar-09 23:08
RezaAsAdi11-Mar-09 23:08 
AnswerRe: How to run an expression which is in string format? Pin
Expert Coming11-Mar-09 23:11
Expert Coming11-Mar-09 23:11 
AnswerRe: How to run an expression which is in string format? Pin
Goobashi11-Mar-09 23:44
Goobashi11-Mar-09 23:44 
QuestionHot to make transparent???? Pin
S K Y11-Mar-09 22:34
S K Y11-Mar-09 22:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.