From 5eb1982af24d5315178d6e1f56d35d1fbf276ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=87=AF?= Date: Mon, 17 Feb 2025 17:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96access=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsturmentData/AccessInstrumentData.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs b/CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs index 8fbbbe4..eba06ec 100644 --- a/CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs +++ b/CnasSynchronusClient/InsturmentData/AccessInstrumentData.cs @@ -44,6 +44,9 @@ namespace CnasSynchronusClient LstFileFullName = new List(); LstFileName = new List(); + 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(); }