473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

directory listing details

I have a simple directoy list bound to a datagrid. I can get the file names,
but is there a way to get the file information from system.io.directory. I'd
like to get file size, creation date, and dropping off the the path from the
file name would not hurt. This can all be done, i know, but i'd like some
advice on the quick simple way.
thanks
kes
(code)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Call databinder()
End If

End Sub
Sub databinder()
dgFiles.DataSource =
Directory.GetFiles("c:\websites\xxxx\upload\files" )
dgFiles.DataBind()
End Sub
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
flFile1.PostedFile.SaveAs("c:\websites\xxxxxx\uplo ad\files\" &
Path.GetFileName(flFile1.PostedFile.FileName))
Call databinder()
End Sub
Nov 19 '05 #1
2 1300
Does System.IO.FileInfo not give you what you need?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a simple directoy list bound to a datagrid. I can get the file
names,
but is there a way to get the file information from
system.io.directory. I'd
like to get file size, creation date, and dropping off the the path
from the
file name would not hurt. This can all be done, i know, but i'd like
some
advice on the quick simple way.
thanks
kes
(code)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Call databinder()
End If
End Sub
Sub databinder()
dgFiles.DataSource =
Directory.GetFiles("c:\websites\xxxx\upload\files" )
dgFiles.DataBind()
End Sub
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles btnUpload.Click
flFile1.PostedFile.SaveAs("c:\websites\xxxxxx\uplo ad\files\" &
Path.GetFileName(flFile1.PostedFile.FileName))
Call databinder()
End Sub


Nov 19 '05 #2
Of course it does, but in others languages like cold fusion the file size and
all other attributes are a part of the file listing. Whe a call to the file
system is made all information is retreaved not just the file (qualified)
name. I was hoping it would be part of the Directory.getfiles call
thanks
kes

"Brock Allen" wrote:
Does System.IO.FileInfo not give you what you need?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a simple directoy list bound to a datagrid. I can get the file
names,
but is there a way to get the file information from
system.io.directory. I'd
like to get file size, creation date, and dropping off the the path
from the
file name would not hurt. This can all be done, i know, but i'd like
some
advice on the quick simple way.
thanks
kes
(code)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Call databinder()
End If
End Sub
Sub databinder()
dgFiles.DataSource =
Directory.GetFiles("c:\websites\xxxx\upload\files" )
dgFiles.DataBind()
End Sub
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles btnUpload.Click
flFile1.PostedFile.SaveAs("c:\websites\xxxxxx\uplo ad\files\" &
Path.GetFileName(flFile1.PostedFile.FileName))
Call databinder()
End Sub


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Horne | last post by:
Just recently I decided I want to make use of my ISP freebie webspace. In order to make that easier, I'd like to be able to automatically synchronise an FTP file/folder heirarchy with one on my...
2
by: Dean | last post by:
Hi I've got a question relating to using Javascript on an Intranet. I have a directory with a list of files in the format week36.xls, week37.xls and I want to write a script that will scan...
19
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing =...
2
by: Tom | last post by:
I need to get a directory listing through http. If I put the directory path in the browser address bar such as http://somewebpage.com/subdir I get the listing of the directory. Of course this is...
8
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
2
by: ngr | last post by:
I used to use the DirListox control in VB6 but this is no longer supported in VB.NET. What I want to do: I want to take a directory listing and show any subdirectories in a list. When you click...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
4
by: techusky | last post by:
I have a *very* simple script written that displays the directory listing of the current working directory, but I am having some difficulty when I try to change folders. Basically, I have my $dir...
1
by: Steve | last post by:
My site is hosted on a Godaddy reseller site. Godaddy only allows the use of Curl to access remote sites. What is the method for listing a directory after connecting to the site with Curl? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.