|
-
August 31st, 2008, 03:35 AM
#1
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
-
August 31st, 2008, 07:32 AM
#2
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
-
September 1st, 2008, 04:00 AM
#3
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:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|