i am creating a website using ASP.NET (C#) using FTP
i have assigned a folder with a storage space let say 1GB to a user now what i want is to keep track of the storage space ulitilized by the user. for eg if a user saves/deletes a file in his folder, how to know that user has saved/deleted something to/from his folder.

any help in this regard will be highly appreciated.

kvprajapati commented: N/A -2

Recommended Answers

All 7 Replies

create a log on every activity..@

i am new to ASP.NET so please explain what u mean by LOG and how to create it.. i want to do it via coding in c#

what i know about log files is that these are used to keep track of website access information but i want to know when a user adds/deletes something from his folder. are there any folder properties which ican set to achieve my task??? THANX

wot i mean is ....
on every operation made by user u can create a Text file
in which you can mark the user acitivity like add/delete/update/
logged in with time..

so basically it's all about file read/ write..
or you can maintain the same thing in the database,which would be pretty much complex

make u r choice..!

are there any folder properties which i can set to achieve my task???

my friend wot i mean is..

if user is doing some activity like update a profile information at the same time
you write in the text file that user update operation made by this
user , from this Ip and this was the time when this happend..

i hope you are getting me this time..
and as i said earlier you can manage the same thing via database.!

I believe you can use the Directory and FileInfo class then store the size in the database and you will keep track of activities.

With the help of Directory class, you will get list of all the files withing specified directory. you can use Directory.GetFiles("directory path","*.*"), it will return array of string.

Now, iterate through each files with the help of string array in below way:

long lfilelength = 0;
foreach(string strName in yourstringarrayvariable)
FileInfo f = new FileInfo(strName);
lfilelength += f.Length;

then just store value of lfilelength in database after each operation i mean addition/deletion of file within directory.


are there any folder properties which i can set to achieve my task???

Be a part of the DaniWeb community

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