我正在尝试将文件存储在datatble
文件夹中,如下面的代码,我尝试了这段代码,但是我在错误的地方工作
private void ViewR_Load(object sender, EventArgs e)
{
String str = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string path = str + "\\images\\";
DataTable dt1 = new DataTable();
dt1.Columns.Add("Images", System.Type.GetType("System.Drawing.Bitmap[]"));
if (System.IO.Directory.Exists(path))
{
string[] allImg = System.IO.Directory.GetFiles(path);
foreach (string imgName in allImg)
{
Image img = new Bitmap(imgName);
//row = dt1.NewRow();
dt1.Rows.Add(img.GetThumbnailImage(350, 350, null, new IntPtr()));
img.Dispose();
}
}
ds.Tables[1].Merge(dt1);
}