listing direct

Results 1 to 2 of 2

Thread: listing direct

  1. #1
    Join Date
    Dec 1969

    Default listing direct

    I have directory of Word Docs. Is it possible to list those using DataReader? I'm not sure which class, if any, I could use to accomplish this task?

  2. #2
    Join Date
    Dec 1969

    Default RE: listing direct

    using System;<BR>using System.Web;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;<BR>using System.Web.UI.HtmlControls;<BR>using System.IO;<BR><BR><BR>namespace Insight.NET<BR>{<BR> /// &#060;summary&#062;<BR> /// Summary description for WebForm1.<BR> /// &#060;/summary&#062;<BR> public class WebForm1 : System.Web.UI.Page<BR> {<BR> protected System.Web.UI.WebControls.DropDownList ddlWord;<BR> <BR> private void Page_Load(object sender, System.EventArgs e)<BR> {<BR> if(!IsPostBack)<BR> getWordDocs();<BR> }<BR><BR> private void getWordDocs()<BR> {<BR> DirectoryInfo di = new DirectoryInfo(Server.MapPath("docs"));<BR> FileInfo[] fi = di.GetFiles("*.doc");<BR> ddlWord.DataSource = fi;<BR> ddlWord.DataBind();<BR> }<BR><BR> }<BR>}<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts