浏览代码

优化access读取。

develop
曾凯 4 个月前
父节点
当前提交
5eb1982af2
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. +6
    -3
      CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs

+ 6
- 3
CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs 查看文件

@@ -44,6 +44,9 @@ namespace CnasSynchronusClient
LstFileFullName = new List<string>(); LstFileFullName = new List<string>();
LstFileName = new List<string>(); LstFileName = new List<string>();


this.StrUser = dataSourceInfo.UserId;
this.StrPwd = dataSourceInfo.UserPwd;

if (AccessFormat.ReadAccessFileMode == "0") if (AccessFormat.ReadAccessFileMode == "0")
{ {
string strSuffix = Path.GetExtension(dataSourceInfo.Path); string strSuffix = Path.GetExtension(dataSourceInfo.Path);
@@ -51,8 +54,6 @@ namespace CnasSynchronusClient
RemoteFileCopy remoteFileCopy = new RemoteFileCopy(dataSourceInfo); RemoteFileCopy remoteFileCopy = new RemoteFileCopy(dataSourceInfo);
remoteFileCopy.CopyFileFromRemote(strSuffix, strFileName); remoteFileCopy.CopyFileFromRemote(strSuffix, strFileName);
this.StrLocalPath = FileHelper.getBasePath() + "\\Cache\\" + System.Text.RegularExpressions.Regex.Replace(dataSourceInfo.Path, "[ \\[ \\] \\^ \\-_*×――(^)|'$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", "").Replace(@"\", "") + strSuffix; this.StrLocalPath = FileHelper.getBasePath() + "\\Cache\\" + System.Text.RegularExpressions.Regex.Replace(dataSourceInfo.Path, "[ \\[ \\] \\^ \\-_*×――(^)|'$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", "").Replace(@"\", "") + strSuffix;
this.StrUser = dataSourceInfo.UserId;
this.StrPwd = dataSourceInfo.UserPwd;


this.strTableName = vs[0].ToString(); this.strTableName = vs[0].ToString();
this.strDateColumn = vs[1].ToString(); this.strDateColumn = vs[1].ToString();
@@ -73,6 +74,7 @@ namespace CnasSynchronusClient
{ {
//遍历当前路径,找到所有“今天”的数据文件,复制形成缓冲文件 //遍历当前路径,找到所有“今天”的数据文件,复制形成缓冲文件
string strSuffix = AccessFormat.AccessSuffix; string strSuffix = AccessFormat.AccessSuffix;

if (dataSourceInfo.Path == "") return; if (dataSourceInfo.Path == "") return;
DirectoryInfo root = new DirectoryInfo(dataSourceInfo.Path); DirectoryInfo root = new DirectoryInfo(dataSourceInfo.Path);
foreach (FileInfo f in root.GetFiles()) foreach (FileInfo f in root.GetFiles())
@@ -89,7 +91,8 @@ namespace CnasSynchronusClient
} }
} }


this.strTableName = AccessFormat.AccessFileTableNameFormat == null ? vs[0].ToString() : AccessFormat.AccessFileTableNameFormat;
//this.strTableName = AccessFormat.AccessFileTableNameFormat == null ? vs[0].ToString() : AccessFormat.AccessFileTableNameFormat;
this.strTableName = vs[0].ToString();
this.strDateColumn = vs[1].ToString(); this.strDateColumn = vs[1].ToString();
this.strDate = vs[2].ToString(); this.strDate = vs[2].ToString();
} }


正在加载...
取消
保存