日期:2014-05-17 浏览次数:20738 次
using (var db = new WEBVODEntities())
{
DocBatchMove docMove;
if (!Directory.Exists(rootParth))
{
Directory.CreateDirectory(rootParth); //新一天上传前的初始化.
docMove = db.DocBatchMove.SingleOrDefault(a => a.Id == 1);
docMove.DirCounter = 1; //目录从1开始
docMove.FileCounter = 0; //文件数从0开始
db.SaveChanges(); //保存到计数数据表 DocBatchMove
}
FileInfo[] files = new DirectoryInfo(txtSource.Text).GetFiles();
foreach (FileInfo f in files) //遍历文件数组
{
#region 遍历文件数组
docMove = db.DocBatchMove.SingleOrDefault(a => a.Id == 1); //获取记录信息
FileCounter = docMove.FileCounter + 1;