Click here to Skip to main content
16,015,691 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with a newer version of a dll Pin
ddecoy27-Jan-10 3:37
ddecoy27-Jan-10 3:37 
GeneralRe: Problem with a newer version of a dll Pin
KittyKit27-Jan-10 4:47
KittyKit27-Jan-10 4:47 
Questionsystem._ComObject databinding [modified] Pin
ddecoy27-Jan-10 2:30
ddecoy27-Jan-10 2:30 
Questionpls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
vidhulibra 27-Jan-10 1:10
vidhulibra 27-Jan-10 1:10 
AnswerRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
#realJSOP27-Jan-10 1:18
professional#realJSOP27-Jan-10 1:18 
AnswerRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
Vikram A Punathambekar27-Jan-10 1:20
Vikram A Punathambekar27-Jan-10 1:20 
AnswerRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
#realJSOP27-Jan-10 1:26
professional#realJSOP27-Jan-10 1:26 
GeneralRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
J4amieC27-Jan-10 2:55
J4amieC27-Jan-10 2:55 
GeneralRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
#realJSOP27-Jan-10 9:36
professional#realJSOP27-Jan-10 9:36 
GeneralRe: pls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
Roger Wright27-Jan-10 18:26
professionalRoger Wright27-Jan-10 18:26 
QuestionSSL Certificate Status? Pin
Sunil G27-Jan-10 0:55
Sunil G27-Jan-10 0:55 
AnswerRe: SSL Certificate Status? Pin
SeMartens27-Jan-10 1:41
SeMartens27-Jan-10 1:41 
AnswerRe: SSL Certificate Status? Pin
Matt Meyer27-Jan-10 5:02
Matt Meyer27-Jan-10 5:02 
QuestionEncrytion and decryption a string [modified] Pin
3bood.ghzawi27-Jan-10 0:44
3bood.ghzawi27-Jan-10 0:44 
AnswerRe: Encrytion and decryption a string Pin
Keith Barrow27-Jan-10 1:13
professionalKeith Barrow27-Jan-10 1:13 
QuestionSQL connectivity issue in My own Windows Serive Pin
WinCrs27-Jan-10 0:29
WinCrs27-Jan-10 0:29 
AnswerRe: SQL connectivity issue in My own Windows Serive Pin
SeMartens27-Jan-10 0:53
SeMartens27-Jan-10 0:53 
AnswerRe: SQL connectivity issue in My own Windows Serive Pin
Covean27-Jan-10 1:01
Covean27-Jan-10 1:01 
AnswerRe: SQL connectivity issue in My own Windows Serive Pin
PIEBALDconsult27-Jan-10 5:32
mvePIEBALDconsult27-Jan-10 5:32 
GeneralRe: SQL connectivity issue in My own Windows Serive Pin
WinCrs27-Jan-10 18:19
WinCrs27-Jan-10 18:19 
Questionrecursive folder compare Pin
vantoora26-Jan-10 23:39
vantoora26-Jan-10 23:39 
AnswerRe: recursive folder compare Pin
SeMartens26-Jan-10 23:55
SeMartens26-Jan-10 23:55 
GeneralRe: recursive folder compare Pin
vantoora27-Jan-10 19:00
vantoora27-Jan-10 19:00 
Thanks for your prompt reply but i think i found another idea. That's getting the list of the first server and try to find it into the second server. If the folder exist, do not care, otherwise log the foldername.fullpath.

for example, suppose i have this :
S1 : c:\rootfolder_S1\folder1\folder2\folder3
S2 : c:\rootfolder_S2\folder1\folder2\folder3

beginning from c:\rootfolder
- get list of folders for one level i got : folder1
- used Path.GetFileNameWithoutExtension(dir) and got : folder1
- use the Path.Combine(S2, foldername) and got : c:\rootfolder_S2\folder1

It's ok and very nice algorithm. But my problem, now, is how can i use this if recursing folders in S1. Using Path.GetFileNameWithoutExtension(dir) will get only the last name of the folder and if combining with S2, will got error or something else.

What i'm going to try is check the size of S1 (rootfolder only), and then use the substring(index) before combining with S2, but how can i get the size or lenght of S1. S1 : c:\rootfolder -> should have 13 characters.

This is my sample code :
static void Main(string[] args)
        {            
            CombinePaths(args[0], args[1]);
        }

private static void CombinePaths(string p1, string p2)
        {
            string[] dirs = Directory.GetDirectories(p1);
            foreach (string dir in dirs)
            {
                try
                {
                    int index = dir.LastIndexOf("\\") + 1;
                    string foldername = dir.Substring(index);
                    string combination = Path.Combine(p2, foldername);
                    if (!Directory.Exists(combination))
                    {
                        Console.WriteLine(dir);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
                Console.WriteLine(Path.GetFileNameWithoutExtension(dir));
                // RecurseFolder(dir,dirs);
            }
        }


this is what i have for now. I'll reply back if found how to have the number of the character of the source string.

Maybe not yet very clear my code but think it is still a draft code.

See you later.
GeneralRe: recursive folder compare Pin
vantoora29-Jan-10 2:16
vantoora29-Jan-10 2:16 
QuestionRendering issue C# Pin
Paul Harsent26-Jan-10 23:28
Paul Harsent26-Jan-10 23:28 

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.