J
Jerry
Hi!,
I am just starting out in c# here and what I want to do is get a list of
files, list them in a a listBox. I want the to beable to select either 1,
2, ... ALL files in this list and execute a job on them.
Here is what I have so far:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace VFSQL
{
public partial class VFFormDataToSQL : Form
{
public VFFormDataToSQL()
{
InitializeComponent();
Page_Load();
}
void Page_Load()
{
DirectoryInfo di = new DirectoryInfo(@"V:\Excalibur\TextData");
FileInfo[] rgFiles = di.GetFiles("*.FDF");
lBDataFiles.Items.AddRange = rgFiles;
// lBDataFiles_SelectedIndexChanged( rgFiles );
foreach (FileInfo fi in rgFiles)
{
Console.WriteLine(fi.Name);
}
}
private void Form1_Load(object sender, EventArgs e)
{
Page_Load();
}
private void lBDataFiles_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void bExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Thanks,
Jerry
I am just starting out in c# here and what I want to do is get a list of
files, list them in a a listBox. I want the to beable to select either 1,
2, ... ALL files in this list and execute a job on them.
Here is what I have so far:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace VFSQL
{
public partial class VFFormDataToSQL : Form
{
public VFFormDataToSQL()
{
InitializeComponent();
Page_Load();
}
void Page_Load()
{
DirectoryInfo di = new DirectoryInfo(@"V:\Excalibur\TextData");
FileInfo[] rgFiles = di.GetFiles("*.FDF");
lBDataFiles.Items.AddRange = rgFiles;
// lBDataFiles_SelectedIndexChanged( rgFiles );
foreach (FileInfo fi in rgFiles)
{
Console.WriteLine(fi.Name);
}
}
private void Form1_Load(object sender, EventArgs e)
{
Page_Load();
}
private void lBDataFiles_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void bExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Thanks,
Jerry