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 :)
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
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. ;)