提交当前本机整理版本
This commit is contained in:
@@ -938,4 +938,33 @@ namespace Lskj.TxtFileRead
|
||||
{
|
||||
string field = item.Replace("{", "").Replace("}", "");
|
||||
string value = row.Table.Columns.Contains(field) ? row[field] + "" : item;
|
||||
value = value.
|
||||
value = value.Replace("'", "''");
|
||||
param = param.Replace(item, value);
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:获取sql语句中替换</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-09-04 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>List<System.String>.</returns>
|
||||
public static List<string> GetParamFields(string defaultValue)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
Regex regex = new Regex("{([^{])+}");
|
||||
MatchCollection mcs = regex.Matches(defaultValue);
|
||||
foreach (Match item in mcs)
|
||||
{
|
||||
if (list.IndexOf(item.Value) == -1)
|
||||
list.Add(item.Value);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user