CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Create a File Manager program

    Hi all,

    I'm new to csharp and dotnet and I'm trying to create a file manager program. I already know java and I'm thinking of learning it by creating this application.

    I'm thinking of making it without a database to display contents of a folder, but all the files in the folder should be created and named through this program. Like if I wanted to create a word document, I can only create it through this program. Also, it should have the check-in check-out functionality.

    Users access to this folder through their windows authentication.

    Can anyone point me to any resources related to these so that i can start.

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Create a File Manager program

    Hi !

    Look at the Directory class File class and FileInfo class for going on with your project

    This are mighty classes and will do a lot for your needs BTW its all contained in the System.IO namespace
    Last edited by JonnyPoet; August 31st, 2008 at 07:55 AM.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  3. #3
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Lightbulb Re: Create a File Manager program

    Here i have some code for you related to File and Directory class that Johny mentioned to them:

    Code:
    static void Main(string[] args)
    {
    string[] files = Directory.GetFiles(@"c:\");
    foreach (string filename in Directory.GetFiles(@"c:\"))
    {
    FileInfo file = new FileInfo(filename);
    Console.WriteLine("{0} created on {1}, and is a {2} file",file.Name, file.CreationTime, 
    file.Extension);
    }
    Console.ReadLine();
    }
    also for File Class:

    Code:
    static void Main(string[] args)
    {
    string[] lines = new string[10];
    for (int i = 0; i < 10; i++)
    {
    lines[i] = String.Format(
    "This is line number {0}", i
    );
    }
    if ( File.Exists(@"c:\test.txt") )
    File.Delete(@"c:\test.txt");
    File.WriteAllLines(@"c:\test.txt", lines );
    foreach( string line in 
    File.ReadAllLines(@"c:\test.txt") )
    {
    Console.WriteLine(line);
    }
    Console.ReadLine();
    }
    Note: As Johny told to you Don't forget to use IO NameSpace at the top of your page by adding this line to your code:

    Code:
     using System.IO;
    Note2: Also maybe you are interested in FileSystemWatcher Class for your porject; i offer you that you check this class in MSDN.

    Touraj Ebrahimi [toraj_e] [at] [yahoo] [dot] [com]

    ------------------------------------------------------------------------------
    Don't Hesitate to Rate My Posts if you are happy with them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured