Pārlūkot izejas kodu

优化access读取。

develop
曾凯 pirms 4 mēnešiem
vecāks
revīzija
5eb1982af2
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. +6
    -3
      CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs

+ 6
- 3
CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs Parādīt failu

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

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

if (AccessFormat.ReadAccessFileMode == "0")
{
string strSuffix = Path.GetExtension(dataSourceInfo.Path);
@@ -51,8 +54,6 @@ namespace CnasSynchronusClient
RemoteFileCopy remoteFileCopy = new RemoteFileCopy(dataSourceInfo);
remoteFileCopy.CopyFileFromRemote(strSuffix, strFileName);
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.strDateColumn = vs[1].ToString();
@@ -73,6 +74,7 @@ namespace CnasSynchronusClient
{
//遍历当前路径,找到所有“今天”的数据文件,复制形成缓冲文件
string strSuffix = AccessFormat.AccessSuffix;

if (dataSourceInfo.Path == "") return;
DirectoryInfo root = new DirectoryInfo(dataSourceInfo.Path);
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.strDate = vs[2].ToString();
}


Notiek ielāde…
Atcelt
Saglabāt