A segment listing the program code for specifying the type file on the server, 丫 真 真 口

xiaoxiao2021-03-06  39

using System; using System.Collections; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; using System.IO; using System.Web; using System.Web.SessionState; using System.Web. Ui; use system.web.ui.webcontrols; using system.web.ui.htmlcontrols;

Summary description of Namespace Bscrm.SHANGPIN {///

///play_picview. /// public class strength_picview: system.web.ui.page {protected system.web.ui.WebControls.DataGrid DataGrid1;

String imagePath = configurationSettings.appsettings ["imagepath"]; string iMageType = "* .jpg | * .jpeg | * .bmp | * .ico | * .emf | * .wmf";

DataSet DS; fileInfo [] ff;

private void Page_Load (object sender, System.EventArgs e) {// Put user code to initialize the page here DirectoryInfo di = new DirectoryInfo (ImagePath); ff = di.GetFiles (); DataGrid1.DataSource = this.GetFileInfo (di IMagType; DataGrid1.databind ();

public Object [] GetFileInfo (System.IO.DirectoryInfo dirInfo, string sSearchPattern) {string [] sSearch = sSearchPattern.Split ( '|'); System.Collections.ArrayList al = new System.Collections.ArrayList (); System.IO .Fileinfo [] fiteMP = null; for (int i = 0; i

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {this.load = new system.eventhandler (this.page_load);

} #Endregion}}}

转载请注明原文地址:https://www.9cbs.com/read-72911.html

New Post(0)