最近又在小舖看到有關這方面的問題...
此範例主要的功能就是利用Directory.GetFiles將某個目錄裡的特定副檔名檔案取出放置在arraylist裡..
並且將arraylist與gridview結合...列出檔案的所有資訊....
再加上一個DropDownList來選擇圖片檔案,並顯示此圖片......c#範例...
DirectoryFileFilter.aspx
01 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DirectoryFileFilter.aspx.cs"
02 Inherits="DirectoryFileFilter" %>
03
04 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
05 <html xmlns="http://www.w3.org/1999/xhtml">
06 <head id="Head1" runat="server">
07 <title>DirectoryFileFilter</title>
08 </head>
09 <body>
10 <form id="form1" runat="server">
11 <div>
12 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
13 </asp:DropDownList>
14 <br />
15 <asp:GridView ID="GridView1" runat="server">
16 </asp:GridView>
17 <asp:Image ID="Image1" runat="server" /></div>
18 </form>
19 </body>
20 </html>
21
DirectoryFileFilter.aspx.cs
執行結果:
參考來源:http://authors.aspalliance.com/stevesmith/articles/directorylist.asp
推到 Twitter!
推到 Plurk!
2008/3/16 23:43|
閱讀數 : 882
|
我要推薦
|
|
文章分類 :
ASP.NET
訂閱
回覆
目前沒有回應.
發表回覆
-
標題: *
-
-
姓名: *
-
-
Email: (將不會被顯示)
-
-
Url:
-
-
回覆: *
-
-