Html i think
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-io' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Carlos Magalhaes
-- Moved from [aspngfreeforall] to [ngfx-io] by Marcie Jones <Click here to reveal e-mail address> --

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>Html i think</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi all,</FONT>
</P>

<P><FONT SIZE=3D2>I have some code that retrieves the file name and =
some attributes from some file(s) now it loops through all the files =
and retrieves all the info and writes that to a text box BUT the =
problem I have now is that I need to show more info in a table like =
format with two columns one for the names  and the other for the =
attributes e.g.</FONT></P>

<P><FONT SIZE=3D2>___________________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile modified</FONT>
<BR><FONT SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>That's is the exact table I need but how do I =
dynamically create that table for each individual file found in the =
dir.</FONT>
</P>

<P><FONT SIZE=3D2>Do for e.g. if there where three files this is what I =
mean (but I can never tell for sure how many files there will be in the =
dir so I need to dynamically make these tables.</FONT></P>

<P><FONT SIZE=3D2>_File1 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile1 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile1 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile1 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile1 modified</FONT>
<BR><FONT SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>_File2 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile2 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile2 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile2 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile2 modified</FONT>
<BR><FONT SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>_File3 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile3 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile3 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile3 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile3 modified</FONT>
<BR><FONT SIZE=3D2>____________________________</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Any help?</FONT>
</P>

<P><FONT SIZE=3D2>Here is the code ( which someone on the list helped =
me with) for the file info.</FONT>
</P>

<P><FONT SIZE=3D2>      Dim di As New =
DirectoryInfo("C:\filenames\")</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp; Dim fi As FileInfo</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp; Dim returnVal As String</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; For Each fi In di.GetFiles()</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp;     returnVal =3D returnVal & fi.Name & =
"," & " "</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp;     Filenames.Text =3D returnVal</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp;     Filepic.Visible =3D True</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp; Next</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; Return returnVal</FONT>
</P>

<P><FONT SIZE=3D2>How can I add it to that .</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Mitch Denny (VIP)
Carlos,

A text box probably isn't the best type of control to
display this type of data in. I think you should take a
look at the DataGrid control in the System.Web.UI.WebControls
namespace. Here is some sample code to get you started.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>

<?xml version="1.0" encoding="utf-8" ?>

<html>

<head>
    
<title>Test</title>
        
<script language="C#" runAt="server">
        
protected override void OnLoad(EventArgs e)
{
            
//Declare locals.
ArrayList files = null;

// Call base implementation.
base.OnLoad(e);
                
// Prepare array for populate and fill with
// instances of the FileInfo class for each
// file in the specified directory.
files = new ArrayList();
foreach (string filename in Directory.GetFiles(@"C:\"))
{

files.Add(
new FileInfo(filename)
);

}

this.Files.DataSource = files;
this.Files.DataBind();
            
}
        
</script>
    
</head>
    
<body>
    
<form runAt="server">
        
<asp:dataGrid
autoGenerateColumns="false"
id="Files"
runAt="server">

<columns>

<asp:BoundColumn DataField="FullName" HeaderText="Filename"
/>

<asp:BoundColumn DataField="CreationTime"
HeaderText="Created" />

<asp:BoundColumn DataField="LastWriteTime"
HeaderText="Modified" />

<asp:BoundColumn DataField="LastAccessTime"
HeaderText="Accessed" />

</columns>

</asp:dataGrid>
                    
</form>
    
</body>

</html>

----------------------------------------
- Mitch Denny
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Monday, 3 June 2002 18:30
To: ngfx-io
Subject: [ngfx-io] Html i think

-- Moved from [aspngfreeforall] to [ngfx-io] by Marcie Jones
<Click here to reveal e-mail address> --

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange
Server version = 5.5.2652.35"> <TITLE>Html i think</TITLE> </HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi all,</FONT>
</P>

<P><FONT SIZE=3D2>I have some code that retrieves the file name and =
some attributes from some file(s) now it loops through all the files =
and retrieves all the info and writes that to a text box BUT the =
problem I have now is that I need to show more info in a table like =
format with two columns one for the names  and the other for the =
attributes e.g.</FONT></P>

<P><FONT SIZE=3D2>___________________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>That's is the exact table I need but how do I =
dynamically create that table for each individual file found in the =
dir.</FONT> </P>

<P><FONT SIZE=3D2>Do for e.g. if there where three files this is what I
= mean (but I can never tell for sure how many files there will be in
the = dir so I need to dynamically make these tables.</FONT></P>

<P><FONT SIZE=3D2>_File1 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile1 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile1 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile1 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile1 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>_File2 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile2 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile2 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile2 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile2 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>

<P><FONT SIZE=3D2>_File3 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile3 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile3 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile3 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile3 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Any help?</FONT>
</P>

<P><FONT SIZE=3D2>Here is the code ( which someone on the list helped =
me with) for the file info.</FONT> </P>

<P><FONT SIZE=3D2>      Dim di As New =
DirectoryInfo("C:\filenames\")</FONT>
<BR><FONT =
SIZE=3D2>          &nb
=
sp; Dim fi As FileInfo</FONT>
<BR><FONT =
SIZE=3D2>          &nb
=
sp; Dim returnVal As String</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb
=
sp; For Each fi In di.GetFiles()</FONT>
<BR><FONT =
SIZE=3D2>          &nb
=
sp;     returnVal =3D returnVal & fi.Name &
= "," & " "</FONT> <BR><FONT =
SIZE=3D2>          &nb
=
sp;     Filenames.Text =3D returnVal</FONT>
<BR><FONT =
SIZE=3D2>          &nb
=
sp;     Filepic.Visible =3D True</FONT> <BR><FONT =
SIZE=3D2>          &nb
=
sp; Next</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb
=
sp; Return returnVal</FONT>
</P>

<P><FONT SIZE=3D2>How can I add it to that .</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

Reply to this message...
 
    
Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>RE: [ngfx-io] RE: Html i think</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>You wouldn't have a vb version of that I have tried =
to convert using the translators (aspalliance) but I receive =
errors.</FONT></P>
<BR>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Mitch Denny [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</=
A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, June 04, 2002 1:10 PM</FONT>
<BR><FONT SIZE=3D2>To: ngfx-io</FONT>
<BR><FONT SIZE=3D2>Subject: [ngfx-io] RE: Html i think</FONT>
</P>

<P><FONT SIZE=3D2>Carlos,</FONT>
</P>

<P><FONT SIZE=3D2>A text box probably isn't the best type of control =
to</FONT>
<BR><FONT SIZE=3D2>display this type of data in. I think you should =
take a</FONT>
<BR><FONT SIZE=3D2>look at the DataGrid control in the =
System.Web.UI.WebControls</FONT>
<BR><FONT SIZE=3D2>namespace. Here is some sample code to get you =
started.</FONT>
</P>

<P><FONT SIZE=3D2><%@ Page Language=3D"C#" %></FONT>
<BR><FONT SIZE=3D2><%@ Import Namespace=3D"System.IO" =
%></FONT>
</P>

<P><FONT SIZE=3D2><?xml version=3D"1.0" =
encoding=3D"utf-8" ?></FONT>
</P>

<P><FONT SIZE=3D2><html></FONT>
</P>

<P><FONT SIZE=3D2>  <head></FONT>
<BR>       =20
<BR><FONT SIZE=3D2>    =
<title>Test</title></FONT>
<BR>        =
       =20
<BR><FONT SIZE=3D2>      <script =
language=3D"C#" runAt=3D"server"></FONT>
<BR>        =
       =20
<BR><FONT SIZE=3D2>        protected =
override void OnLoad(EventArgs e)</FONT>
<BR><FONT SIZE=3D2>        {</FONT>
<BR>        =
        =
       =20
<BR><FONT =
SIZE=3D2>          =
//Declare locals.</FONT>
<BR><FONT =
SIZE=3D2>          =
ArrayList files =3D null;</FONT>
</P>

<P><FONT =
SIZE=3D2>          // Call =
base implementation.</FONT>
<BR><FONT =
SIZE=3D2>          =
base.OnLoad(e);</FONT>
<BR>        =
        =
        =
       =20
<BR><FONT =
SIZE=3D2>          // =
Prepare array for populate and fill with</FONT>
<BR><FONT =
SIZE=3D2>          // =
instances of the FileInfo class for each</FONT>
<BR><FONT =
SIZE=3D2>          // file =
in the specified directory.</FONT>
<BR><FONT =
SIZE=3D2>          files =
=3D new ArrayList();</FONT>
<BR><FONT =
SIZE=3D2>          foreach =
(string filename in Directory.GetFiles(@"C:\"))</FONT>
<BR><FONT =
SIZE=3D2>          =
{</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; files.Add(</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp;   new FileInfo(filename)</FONT>
<BR><FONT =
SIZE=3D2>          &nb=
sp;   );</FONT>
</P>

<P><FONT =
SIZE=3D2>          =
}</FONT>
</P>

<P><FONT =
SIZE=3D2>          =
this.Files.DataSource =3D files;</FONT>
<BR><FONT =
SIZE=3D2>          =
this.Files.DataBind();</FONT>
<BR>        =
        =
       =20
<BR><FONT SIZE=3D2>        }</FONT>
<BR>        =
       =20
<BR><FONT SIZE=3D2>      =
</script></FONT>
<BR>       =20
<BR><FONT SIZE=3D2>    </head></FONT>
<BR>       =20
<BR><FONT SIZE=3D2>    <body></FONT>
<BR>       =20
<BR><FONT SIZE=3D2>      <form =
runAt=3D"server"></FONT>
<BR>        =
       =20
<BR><FONT SIZE=3D2>        =
<asp:dataGrid</FONT>
<BR><FONT =
SIZE=3D2>          =
autoGenerateColumns=3D"false"</FONT>
<BR><FONT =
SIZE=3D2>          =
id=3D"Files"</FONT>
<BR><FONT =
SIZE=3D2>          =
runAt=3D"server"></FONT>
</P>

<P><FONT =
SIZE=3D2>          =
<columns></FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; <asp:BoundColumn DataField=3D"FullName" =
HeaderText=3D"Filename"</FONT>
<BR><FONT =
SIZE=3D2>/>         &nbs=
p;  </FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; <asp:BoundColumn DataField=3D"CreationTime"</FONT>
<BR><FONT SIZE=3D2>HeaderText=3D"Created" =
/>            =
</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; <asp:BoundColumn DataField=3D"LastWriteTime"</FONT>
<BR><FONT SIZE=3D2>HeaderText=3D"Modified" =
/>            =
</FONT>
</P>

<P><FONT =
SIZE=3D2>          &nb=
sp; <asp:BoundColumn DataField=3D"LastAccessTime"</FONT>
<BR><FONT SIZE=3D2>HeaderText=3D"Accessed" =
/>            =
</FONT>
</P>

<P><FONT =
SIZE=3D2>          =
</columns></FONT>
</P>

<P><FONT SIZE=3D2>        =
</asp:dataGrid></FONT>
<BR>        =
        =
        =
        =
       =20
<BR><FONT SIZE=3D2>      </form></FONT>
<BR>       =20
<BR><FONT SIZE=3D2>    </body></FONT>
<BR><FONT SIZE=3D2>    </FONT>
<BR><FONT SIZE=3D2>  </html></FONT>
</P>

<P><FONT SIZE=3D2>----------------------------------------</FONT>
<BR><FONT SIZE=3D2>- Mitch Denny</FONT>
<BR><FONT SIZE=3D2>- Click here to reveal e-mail address</FONT>
<BR><FONT SIZE=3D2>- +61 (414) 610-141</FONT>
<BR><FONT SIZE=3D2>-</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Carlos Magalhaes [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, 3 June 2002 18:30</FONT>
<BR><FONT SIZE=3D2>To: ngfx-io</FONT>
<BR><FONT SIZE=3D2>Subject: [ngfx-io] Html i think</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-- Moved from [aspngfreeforall] to [ngfx-io] by =
Marcie Jones</FONT>
<BR><FONT SIZE=3D2><Click here to reveal e-mail address> --</FONT>
</P>

<P><FONT SIZE=3D2><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML =
3.2//EN"></FONT>
<BR><FONT SIZE=3D2><HTML></FONT>
<BR><FONT SIZE=3D2><HEAD></FONT>
<BR><FONT SIZE=3D2><META HTTP-EQUIV=3D3D"Content-Type" =
CONTENT=3D3D"text/html; =3D</FONT>
<BR><FONT SIZE=3D2>charset=3D3Dus-ascii"> <META =
NAME=3D3D"Generator" CONTENT=3D3D"MS Exchange</FONT>
<BR><FONT SIZE=3D2>Server version =3D 5.5.2652.35"> =
<TITLE>Html i think</TITLE> </HEAD></FONT>
<BR><FONT SIZE=3D2><BODY></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>Hi =
all,</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>I have some code that =
retrieves the file name and =3D</FONT>
<BR><FONT SIZE=3D2>some attributes from some file(s) now it loops =
through all the files =3D</FONT>
<BR><FONT SIZE=3D2>and retrieves all the info and writes that to a text =
box BUT the =3D</FONT>
<BR><FONT SIZE=3D2>problem I have now is that I need to show more info =
in a table like =3D</FONT>
<BR><FONT SIZE=3D2>format with two columns one for the names&nbsp; =
and the other for the =3D</FONT>
<BR><FONT SIZE=3D2>attributes e.g.</FONT></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT =
SIZE=3D3D2>___________________________</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Name | Myfile =
Name</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Size | Myfile =
Size</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Type | Myfile =
Type</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Mod&nbsp; =
| Myfile modified</FONT> <BR><FONT</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>____________________________</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>That's is the exact =
table I need but how do I =3D</FONT>
<BR><FONT SIZE=3D2>dynamically create that table for each individual =
file found in the =3D</FONT>
<BR><FONT SIZE=3D2>dir.</FONT> </P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>Do for e.g. if there =
where three files this is what I</FONT>
<BR><FONT SIZE=3D2>=3D mean (but I can never tell for sure how many =
files there will be in</FONT>
<BR><FONT SIZE=3D2>the =3D dir so I need to dynamically make these =
tables.</FONT></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>_File1 =
..___________________</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Name | Myfile1 =
Name</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Size | Myfile1 =
Size</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Type | Myfile1 =
Type</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Mod&nbsp; =
| Myfile1 modified</FONT> <BR><FONT</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>____________________________</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>_File2 =
..___________________</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Name | Myfile2 =
Name</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Size | Myfile2 =
Size</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Type | Myfile2 =
Type</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Mod&nbsp; =
| Myfile2 modified</FONT> <BR><FONT</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>____________________________</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>_File3 =
..___________________</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Name | Myfile3 =
Name</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Size | Myfile3 =
Size</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Type | Myfile3 =
Type</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT SIZE=3D3D2>File Mod&nbsp; =
| Myfile3 modified</FONT> <BR><FONT</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>____________________________</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
<BR><FONT SIZE=3D2><BR></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>Any =
help?</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>Here is the code ( =
which someone on the list helped =3D</FONT>
<BR><FONT SIZE=3D2>me with) for the file info.</FONT> =
</P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT =
SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim di =
As New =3D</FONT>
<BR><FONT =
SIZE=3D2>DirectoryInfo(&quot;C:\filenames\&quot;)</FONT></=
FONT>
<BR><FONT SIZE=3D2><BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp; Dim fi As FileInfo</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp; Dim returnVal As String</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp; For Each fi In di.GetFiles()</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp;&nbsp;&nbsp;&nbsp;&nbsp; =
returnVal =3D3D returnVal &amp; fi.Name &amp;</FONT>
<BR><FONT SIZE=3D2>=3D &quot;,&quot; &amp; &quot; =
&quot;</FONT> <BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp;&nbsp;&nbsp;&nbsp;&nbsp; =
Filenames.Text =3D3D returnVal</FONT></FONT>
<BR><FONT SIZE=3D2><BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp;&nbsp;&nbsp;&nbsp;&nbsp; =
Filepic.Visible =3D3D True</FONT> <BR><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp; Next</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT =3D</FONT>
<BR><FONT =
SIZE=3D2>SIZE=3D3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb</FONT>
<BR><FONT SIZE=3D2>=3D</FONT>
<BR><FONT SIZE=3D2>sp; Return returnVal</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2><P><FONT SIZE=3D3D2>How can I add it to =
that .</FONT></FONT>
<BR><FONT SIZE=3D2></P></FONT>
</P>

<P><FONT SIZE=3D2></BODY></FONT>
<BR><FONT SIZE=3D2></HTML></FONT>
</P>

<P><FONT =
SIZE=3D2>-------------------------------------------------------------</=
FONT>
<BR><FONT SIZE=3D2>This email and any files transmitted are</FONT>
<BR><FONT SIZE=3D2>confidential and intended solely for the</FONT>
<BR><FONT SIZE=3D2>use of the individual or entity to which</FONT>
<BR><FONT SIZE=3D2>they are addressed, whose privacy</FONT>
<BR><FONT SIZE=3D2>should be respected.  Any views or</FONT>
<BR><FONT SIZE=3D2>opinions are solely those of the author</FONT>
<BR><FONT SIZE=3D2>and do not necessarily represent those</FONT>
<BR><FONT SIZE=3D2>of the Trencor Group, or any of its</FONT>
<BR><FONT SIZE=3D2>representatives, unless specifically</FONT>
<BR><FONT SIZE=3D2>stated.  </FONT>
</P>

<P><FONT SIZE=3D2>Email transmission cannot be guaranteed</FONT>
<BR><FONT SIZE=3D2>to be secure, error free or without virus</FONT>
<BR><FONT SIZE=3D2>contamination.  The sender therefore</FONT>
<BR><FONT SIZE=3D2>accepts no liability for any errors or</FONT>
<BR><FONT SIZE=3D2>omissions in the contents of this message,</FONT>
<BR><FONT SIZE=3D2>nor for any virus infection that might result</FONT>
<BR><FONT SIZE=3D2>from opening this message.  Trencor is =
not</FONT>
<BR><FONT SIZE=3D2>responsible in the event of any third party</FONT>
<BR><FONT SIZE=3D2>interception of this email.   </FONT>
</P>

<P><FONT SIZE=3D2>If you have received this email in error please =
notify</FONT>
<BR><FONT SIZE=3D2>Click here to reveal e-mail address   For more =
information about</FONT>
<BR><FONT SIZE=3D2>Trencor, visit www.trencor.net <<A =
HREF=3D"http://www.trencor.net" =
TARGET=3D"_blank">http://www.trencor.net</A>></FONT>
</P>

<P><FONT SIZE=3D2>| [ngfx-io] member Click here to reveal e-mail address =3D YOUR =
ID </FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.aspfriends.com/aspfriends/ngfx-io.asp"" target="_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp"; =
TARGET=3D"_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp</A> =
=3D JOIN/QUIT</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>| [ngfx-io] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.aspfriends.com/aspfriends/ngfx-io.asp"" target="_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp"; =
TARGET=3D"_blank">http://www.aspfriends.com/aspfriends/ngfx-io.asp</A> =
=3D JOIN/QUIT</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Mitch Denny (VIP)
Carlos,

Here is the appropriate VB code:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>

<?xml version="1.0" encoding="utf-8" ?>

<html>

<head>

<title>Test</title>

<script language="VB" runAt="server">

Protected Overrides Sub OnLoad(e As EventArgs)

' Declare locals.
Dim files As ArrayList
Dim filename As String

' Call base implementation.
MyBase.OnLoad(e)

' Prepare array for population and fill with
' instances of the FileInfo class for each
' file in the specified directory.
files = New ArrayList()
For Each filename In Directory.GetFiles("C:\")

files.Add( _
New FileInfo(filename) _
)

Next

Me.Files.DataSource = files
Me.Files.DataBind()

End Sub

</script>

</head>

<body>

<form runAt="server">

<asp:dataGrid
autoGenerateColumns="false"
id="Files"
runAt="server">

<columns>

<asp:BoundColumn DataField="FullName" HeaderText="Filename" />

<asp:BoundColumn DataField="CreationTime" HeaderText="Created"
/>

<asp:BoundColumn DataField="LastWriteTime"
HeaderText="Modified" />

<asp:BoundColumn DataField="LastAccessTime"
HeaderText="Accessed" />

</columns>

</asp:dataGrid>

</form>

</body>

</html>

Also, I realised that my naming of variables might have
been slightly confusing. I named the data grid "Files" and
also declare a local in the OnLoad method as "files". Make
note that these are distinct, and I have gotten around any
name conflicts by prefixing the member with "Me".

----------------------------------------
- Mitch Denny
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Tuesday, 4 June 2002 22:42
To: ngfx-io
Subject: [ngfx-io] RE: Html i think

You wouldn't have a vb version of that I have tried to convert using the
translators (aspalliance) but I receive errors.

-----Original Message-----
From: Mitch Denny [mailto:Click here to reveal e-mail address]
Sent: Tuesday, June 04, 2002 1:10 PM
To: ngfx-io
Subject: [ngfx-io] RE: Html i think
Carlos,
A text box probably isn't the best type of control to
display this type of data in. I think you should take a
look at the DataGrid control in the System.Web.UI.WebControls
namespace. Here is some sample code to get you started.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<?xml version="1.0" encoding="utf-8" ?>
<html>
<head>

<title>Test</title>

<script language="C#" runAt="server">

protected override void OnLoad(EventArgs e)
{

//Declare locals.
ArrayList files = null;
// Call base implementation.
base.OnLoad(e);

// Prepare array for populate and fill with
// instances of the FileInfo class for each
// file in the specified directory.
files = new ArrayList();
foreach (string filename in Directory.GetFiles(@"C:\"))
{
files.Add(
new FileInfo(filename)
);
}
this.Files.DataSource = files;
this.Files.DataBind();

}

</script>

</head>

<body>

<form runAt="server">

<asp:dataGrid
autoGenerateColumns="false"
id="Files"
runAt="server">
<columns>
<asp:BoundColumn DataField="FullName" HeaderText="Filename"
/>
<asp:BoundColumn DataField="CreationTime"
HeaderText="Created" />
<asp:BoundColumn DataField="LastWriteTime"
HeaderText="Modified" />
<asp:BoundColumn DataField="LastAccessTime"
HeaderText="Accessed" />
</columns>
</asp:dataGrid>

</form>

</body>

</html>
----------------------------------------
- Mitch Denny
- Click here to reveal e-mail address
- +61 (414) 610-141
-
-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Monday, 3 June 2002 18:30
To: ngfx-io
Subject: [ngfx-io] Html i think

-- Moved from [aspngfreeforall] to [ngfx-io] by Marcie Jones
<Click here to reveal e-mail address> --
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange
Server version = 5.5.2652.35"> <TITLE>Html i think</TITLE> </HEAD>
<BODY>
<P><FONT SIZE=3D2>Hi all,</FONT>
</P>
<P><FONT SIZE=3D2>I have some code that retrieves the file name and =
some attributes from some file(s) now it loops through all the files =
and retrieves all the info and writes that to a text box BUT the =
problem I have now is that I need to show more info in a table like =
format with two columns one for the names  and the other for the =
attributes e.g.</FONT></P>
<P><FONT SIZE=3D2>___________________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>
<P><FONT SIZE=3D2>That's is the exact table I need but how do I =
dynamically create that table for each individual file found in the =
dir.</FONT> </P>
<P><FONT SIZE=3D2>Do for e.g. if there where three files this is what I
= mean (but I can never tell for sure how many files there will be in
the = dir so I need to dynamically make these tables.</FONT></P>
<P><FONT SIZE=3D2>_File1 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile1 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile1 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile1 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile1 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>
<P><FONT SIZE=3D2>_File2 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile2 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile2 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile2 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile2 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>
<P><FONT SIZE=3D2>_File3 ..___________________</FONT>
<BR><FONT SIZE=3D2>File Name | Myfile3 Name</FONT>
<BR><FONT SIZE=3D2>File Size | Myfile3 Size</FONT>
<BR><FONT SIZE=3D2>File Type | Myfile3 Type</FONT>
<BR><FONT SIZE=3D2>File Mod  | Myfile3 modified</FONT> <BR><FONT
SIZE=3D2>____________________________</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Any help?</FONT>
</P>
<P><FONT SIZE=3D2>Here is the code ( which someone on the list helped =
me with) for the file info.</FONT> </P>
<P><FONT SIZE=3D2>      Dim di As New =
DirectoryInfo("C:\filenames\")</FONT>
<BR><FONT =
SIZE=3D2>          &nb

=
sp; Dim fi As FileInfo</FONT>
<BR><FONT =
SIZE=3D2>          &nb

=
sp; Dim returnVal As String</FONT>
</P>
<P><FONT =
SIZE=3D2>          &nb

=
sp; For Each fi In di.GetFiles()</FONT>
<BR><FONT =
SIZE=3D2>          &nb

=
sp;     returnVal =3D returnVal & fi.Name &
= "," & " "</FONT> <BR><FONT =
SIZE=3D2>          &nb

=
sp;     Filenames.Text =3D returnVal</FONT>
<BR><FONT =
SIZE=3D2>          &nb

=
sp;     Filepic.Visible =3D True</FONT> <BR><FONT =
SIZE=3D2>          &nb

=
sp; Next</FONT>
</P>
<P><FONT =
SIZE=3D2>          &nb

=
sp; Return returnVal</FONT>
</P>
<P><FONT SIZE=3D2>How can I add it to that .</FONT>
</P>
</BODY>
</HTML>
-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.
Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.
If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
------------------------------------------------------------- This email
and any files transmitted are confidential and intended solely for the
use of the individual or entity to which they are addressed, whose
privacy should be respected. Any views or opinions are solely those of
the author and do not necessarily represent those of the Trencor Group,
or any of its representatives, unless specifically stated. Email
transmission cannot be guaranteed to be secure, error free or without
virus contamination. The sender therefore accepts no liability for any
errors or omissions in the contents of this message, nor for any virus
infection that might result from opening this message. Trencor is not
responsible in the event of any third party interception of this email.
If you have received this email in error please notify
Click here to reveal e-mail address For more information about Trencor, visit
www.trencor.net

Reply to this message...
 
 
System.Collections.ArrayList
System.EventArgs
System.IO.Directory
System.IO.DirectoryInfo
System.IO.FileInfo
System.Web.UI.WebControls.BoundColumn
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com