I am newbie in programing, and learning it...

I need to know how do i make that program:
Examples will help...

I need to use UDP communication to connect to server by client and search, at server,for the longest directory, get the longest directory path and number of deepest level, sand it back to client and print it at client.
Also, the server will return the number of clients who connected to the Server.
And print it both at server and client side.

The Client and Server run on windows console (without GUI).
The Client will have basic DOS menu, that the USER can select
1. "Start Search and Print Results".
2. "Print Last results (deepest level)".
3. "Print Last result (Path)".
4. "Print Number of Clients".
5. "Exit".

Thank you, in advance!
It like a project for me, and really need how to make it work...

Thanks again for helpers, experts!

Recommended Answers

Show us what you have so far.

Jump to Post

All 2 Replies

Show us what you have so far.

i have make scan for deepest level for local client , i do not have a clue how to switch for UDP connection, please help.

Here what i have done so far:

#pragma warning(disable : 4996)

#include "Scan API.h"

typedef struct
    int nDeepestLevel;
    char sDeepestDirectory[MAX_PATH+1];


BOOL DeepestDirectory(int nLevel, const char* pPath, const WIN32_FIND_DATA* pFD, void* pParam)

    if (nLevel == pDLI->nDeepestLevel)
        pDLI->nDeepestLevel = nLevel + 1;
        strcat(strcat(strcpy(pDLI->sDeepestDirectory, pPath), "\\"), pFD->cFileName);
    return TRUE;


int GetLongestDirectoryChain(const char* pPath, char* pChain)
    //* Initialize globals
        dli.nDeepestLevel = 0;
        dli.sDeepestDirectory [0] = 0;

        //* Start scanning
        Scan(pPath, DeepestDirectory, 0, &dli);
        strcpy(pChain, dli.sDeepestDirectory);

    return dli.nDeepestLevel;


Also, make Scan API.h for order scan the file (findfirst, findnext...).


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.