Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all don't know if im in the right place but here goes. Im new with programming and for new project I am developing a file management program but dont have a clue where to start.
IM USING C# CONSOLE!
BELOW ARE THE SPECS!


• Display a welcome message and a menu of operations (see below).

• Display the current folder. Initially should be the folder "C:\Windows".

• Prompt the user to select one of the operations:

1. Full File Listing: Display the filenames and lengths of all the files in the current folder. The format for the directory listing should be like this:

Files in: C:\Windows
1. explorer.exe (2871808)
2. ODBC.ini (376)
3. winhlp32.exe (9728)
...
2. Filtered File Listing: ask the user for a file filter and display only the files in the current folder that match that filter. An example of a filter might be "*.exe", which only shows the files ending with .exe (* matches any filename, so this filter reads in English as "any filename ending in .exe"). The display should be formatted in the same way as the full file listing, except you should also display the filter used.

3. Folder Statistics: Display the following statistics about all the files in the current folder. Do not list any files in this case.
Files in: C:\Windows
Total files: 49
Total size of all files: 7121424 bytes
Largest file: explorer.exe, 2871808 bytes
Average file length: 145335 bytes

4. Quit, to exit the program


Big thanks in advance.
Posted
Updated 22-Nov-11 9:44am
v3
Comments
Nikil S 22-Nov-11 17:47pm    
"4. Quit, to exit the program" - This made me remember my college days.

don't have a clue where to start.
For such an obvious homework question this suggests that you should go back to your notes and study the bits about creating a program, printing messages, getting input from the user, and using the various file and directory functions necessary to list file details. None of this is too difficult to find either via Google or direct in MSDN. By making some effort and showing what you have tried you may find people are more willing to help, but no one is going to write this program for you.
 
Share this answer
 
 
Share this answer
 
The requirements seem straightforward. You should meed them and do it all by yourself.

Except just one which is simply idiotic:

A brainless teacher wrote:
Display the current folder. Initially should be the folder "C:\Windows".
You can always print current working directory, but the other part of this requirement makes no sense because this is not up to the developer to decide what the current directory is. It is defined by the user and only by the user. Even though the executable directory can be "C:\Windows", the user can run it like this:

cd "\Documents and Settings\VasiaPupkin\"
c:\Window\StupidApplication.exe


and the working directory will be "\Documents and Settings\VasiaPupkin" or anything. Moreover, putting a third-party developed executable to "C:\Windows" is considered illegal. Try to do it in Windows 7 not being in an Administrators group and not having administrator's privileges and see what happens.

No, no, that could be just a random mistake of your teacher, but it makes the requirements impossible to meet.

Perhaps here you are getting a change to train one of most important skills in software development: how to speak up and avoid doing a damage. You should understand this problem, go back to you teacher, explain this problem and convince her/him that this requirements cannot be met, so she/he would fix this assignment. A good teacher should appreciate that, and the one who would not maybe not deserves to teach.

So, do you think it's difficult? Welcome to engineering world!

—SA
 
Share this answer
 
Comments
Philippe Mori 22-Nov-11 19:24pm    
I don't think that the program has to be installed in c:\windows and it is not a problem to list files in that folder even though it is not a discutable choice from the part of the teacher.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900