Click here to Skip to main content
15,904,024 members
Home / Discussions / C#
   

C#

 
GeneralRe: nextline Pin
Colin Angus Mackay18-Oct-07 23:24
Colin Angus Mackay18-Oct-07 23:24 
GeneralRe: nextline Pin
zeeShan anSari18-Oct-07 23:38
zeeShan anSari18-Oct-07 23:38 
QuestionPrinting in C# [modified] Pin
Maddie from Dartford18-Oct-07 22:59
Maddie from Dartford18-Oct-07 22:59 
AnswerRe: Printing in C# Pin
Abhijit Jana18-Oct-07 23:59
professionalAbhijit Jana18-Oct-07 23:59 
GeneralRe: Printing in C# Pin
Maddie from Dartford19-Oct-07 0:32
Maddie from Dartford19-Oct-07 0:32 
QuestionPrevent to removing row from DataTable Pin
El'Cachubrey18-Oct-07 21:37
El'Cachubrey18-Oct-07 21:37 
AnswerRe: Prevent to removing row from DataTable Pin
il_masacratore18-Oct-07 22:50
il_masacratore18-Oct-07 22:50 
QuestionGet files from rar-span Pin
Johan Martensson18-Oct-07 21:19
Johan Martensson18-Oct-07 21:19 
Could someone please help me with this loop I'm working on.
The goal is to end up with a list of rar-files to be deleted after unpacking.

I have a list of the first rar-files in the span and I want to get the rest.

For the new-style rar-files, I figured I remove the ".rar" and ".part" from the filename
and just add one number higher, but that doesn't work since there are zeros to account for.

For the old-style rar-files I'm even more lost since there are booth zeros and letters added.
I know the letters are added one higher but I can't figure out a good way to do it.

This is what I've got now:

"rarsToDelete" contains the first rar-files in span
"rarSpanList" should contain the rest of the files in the end

private void DeleteRarFiles()<br />
{<br />
    if(rarsToDelete != null)<br />
    {<br />
        ArrayList rarSpanList = new ArrayList();<br />
        foreach (string s in rarsToDelete)<br />
        {<br />
            string fileNoExt = s.ToLower().Substring(0, s.LastIndexOf(".")-1);<br />
            if(fileNoExt.EndsWith(".part1"))<br />
            {<br />
                string fileNoExtNoPart = fileNoExt.Substring(0, s.LastIndexOf(".") - 1);<br />
                int i=2;<br />
                string testFile = fileNoExtNoPart + "part" + i;<br />
                while (File.Exists(fileNoExtNoPart + "part" + i))<br />
                {<br />
                    rarSpanList.Add(testFile);<br />
                    i++;<br />
                }<br />
<br />
            }<br />
            else if(File.Exists(fileNoExt+".r00"))<br />
            {<br />
                <br />
            }<br />
        }<br />
    }<br />
}


Thanks
AnswerRe: Get files from rar-span Pin
leppie19-Oct-07 4:57
leppie19-Oct-07 4:57 
Question[Message Deleted] Pin
Trustapple18-Oct-07 21:01
Trustapple18-Oct-07 21:01 
AnswerRe: accessibilty Pin
stancrm18-Oct-07 21:14
stancrm18-Oct-07 21:14 
AnswerRe: accessibilty Pin
Nouman Bhatti18-Oct-07 21:17
Nouman Bhatti18-Oct-07 21:17 
AnswerRe: accessibilty Pin
Malcolm Smart18-Oct-07 21:40
Malcolm Smart18-Oct-07 21:40 
AnswerRe: accessibilty Pin
J4amieC18-Oct-07 22:06
J4amieC18-Oct-07 22:06 
AnswerRe: [Message Deleted] Pin
J4amieC18-Oct-07 23:06
J4amieC18-Oct-07 23:06 
GeneralRe: [Message Deleted] Pin
Malcolm Smart18-Oct-07 23:11
Malcolm Smart18-Oct-07 23:11 
Questionopen an html file Pin
kuscu18-Oct-07 20:56
kuscu18-Oct-07 20:56 
AnswerRe: open an html file Pin
Malcolm Smart18-Oct-07 20:59
Malcolm Smart18-Oct-07 20:59 
GeneralRe: open an html file Pin
kuscu22-Oct-07 11:03
kuscu22-Oct-07 11:03 
GeneralRe: open an html file Pin
Malcolm Smart22-Oct-07 11:38
Malcolm Smart22-Oct-07 11:38 
AnswerRe: open an html file Pin
Kristian Sixhøj18-Oct-07 21:01
Kristian Sixhøj18-Oct-07 21:01 
AnswerRe: open an html file Pin
N a v a n e e t h18-Oct-07 21:02
N a v a n e e t h18-Oct-07 21:02 
Questionexport report! pls help Pin
k.philip18-Oct-07 20:13
k.philip18-Oct-07 20:13 
AnswerRe: export report! pls help Pin
Malcolm Smart18-Oct-07 21:01
Malcolm Smart18-Oct-07 21:01 
QuestionActiveX and Windows Service Pin
Guillermo Rivero18-Oct-07 19:39
Guillermo Rivero18-Oct-07 19:39 

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.