提交当前本机整理版本
This commit is contained in:
@@ -477,4 +477,40 @@ namespace AfkDataService
|
||||
// try
|
||||
// {
|
||||
// MySqlHelper._connection.Close();
|
||||
//
|
||||
// MySqlHelper._connection.Dispose();
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// }
|
||||
// MySqlHelper._connection = null;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// MySqlHelper._connection = new MySqlConnection(connStr);
|
||||
// MySqlHelper._connection.Open();
|
||||
// return true;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine(ex.Message);
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
#endregion
|
||||
public void SendMessage(TextBox textBox, string message)
|
||||
{
|
||||
if (textBox.InvokeRequired)
|
||||
{
|
||||
textBox.Invoke(new Action(() =>
|
||||
{
|
||||
textBox.AppendText(message);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox.AppendText(message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -851,3 +851,35 @@ namespace AfkDataService
|
||||
{
|
||||
stringBuilder.Append($"getdate() as {selectRow["Field"]},");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
return stringBuilder;
|
||||
}
|
||||
/// <summary>
|
||||
/// 改变afk的同步标识
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="dataDirection"></param>
|
||||
/// <returns></returns>
|
||||
private string GetChangeSynchroTagSql(AbutmentModel abutmentModel)
|
||||
{
|
||||
string sql = "";
|
||||
try
|
||||
{
|
||||
string conditions = string.Empty;
|
||||
conditions = abutmentModel.targetStrs.Length == 2 ? " where isSynchro is null and " + abutmentModel.targetStrs[1] : "";
|
||||
sql = string.Format("update {0} set isSynchro='1' {1} ", abutmentModel.afkTabName, conditions);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ExecPythonPDF")]
|
||||
[assembly: Assemb
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ExecPythonPDF")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("cfb86248-5da9-4f84-b2bb-6044b62c1ddc")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
@@ -36,4 +36,28 @@ namespace ExecPythonPDF.Properties {
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static glo
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExecPythonPDF.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <a
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ExecPythonPDF.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,4 +588,32 @@ namespace ExecPythonPDF
|
||||
int endLimit = nextMatch != null ? nextMatch.Index : content.Length;
|
||||
|
||||
int endP = p;
|
||||
while (endP < endLimit && !char.IsWhiteSpace(content[endP])) endP++;
|
||||
|
||||
return content.Substring(p, endP - p).Trim();
|
||||
}
|
||||
}
|
||||
|
||||
// --- 工厂类 ---
|
||||
public static class BankExtractorFactory
|
||||
{
|
||||
private static readonly Dictionary<string, BankExtractor> Extractors = new Dictionary<string, BankExtractor>
|
||||
{
|
||||
{ "中国银行", new BOCExtractor() },
|
||||
{ "工商银行", new ICBCExtractor() },
|
||||
{ "成都银行", new ChengduBankExtractor() },
|
||||
{ "民生银行", new CMBCExtractor() },
|
||||
{ "浙商银行", new CZBankExtractor() }
|
||||
};
|
||||
|
||||
public static BankExtractor GetExtractor(string bankName) =>
|
||||
Extractors.ContainsKey(bankName) ? Extractors[bankName] : null;
|
||||
|
||||
public static string IdentifyBank(string filename)
|
||||
{
|
||||
foreach (var key in Extractors.Keys)
|
||||
if (filename.Contains(key)) return key;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -11,4 +11,35 @@ namespace PDFApi.Controllers
|
||||
[Route("Api/ProcessPDF")] // 自定义路由
|
||||
public IHttpActionResult ProcessPDF([FromBody] PDFRequest request)
|
||||
{
|
||||
|
||||
JObject rtnJobject = new JObject();
|
||||
rtnJobject.Add("success", "false");
|
||||
rtnJobject.Add("code", "0");
|
||||
rtnJobject.Add("msg", "");
|
||||
rtnJobject.Add("data", new JArray());
|
||||
try
|
||||
{
|
||||
if (request != null)
|
||||
{
|
||||
rtnJobject = PDFConvert.ExecutePdfExtraction(request.FileUrl, request.FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("空数据");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rtnJobject["success"] = "false";
|
||||
rtnJobject["code"] = "0";
|
||||
rtnJobject["msg"] = ex.Message;
|
||||
}
|
||||
return Ok(rtnJobject);
|
||||
}
|
||||
// 定义接收参数的实体类
|
||||
public class PDFRequest
|
||||
{
|
||||
public string FileUrl { get; set; }
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -6,3 +6,30 @@ using System.Runtime.InteropServices;
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("PDFApi")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PDFApi")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要
|
||||
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
|
||||
[assembly: Guid("dd0c73ce-e2c0-4fff-9a0f-3e40fce1d46a")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订版本
|
||||
//
|
||||
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
|
||||
// 方法是按如下所示使用 "*":
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
+29
@@ -338,4 +338,33 @@ namespace GetApiData
|
||||
this.Controls.Add(this.labelServerName);
|
||||
this.Controls.Add(this.textBaseName);
|
||||
this.Controls.Add(this.textServerName);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "FrmMain";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "蕊源同步工具";
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
private TextBox k3appId;
|
||||
private TextBox k3ServerName;
|
||||
private Label label3;
|
||||
private TextBox k3appSecret;
|
||||
private Label label4;
|
||||
private TextBox k3dbId;
|
||||
private Label label5;
|
||||
private TextBox k3userName;
|
||||
private Label label6;
|
||||
private TextBox k3number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,4 +585,36 @@ namespace GetApiData
|
||||
decimal famount = details.Sum(d => SafeToDecimal(d, "wms_ljoins_famount"));
|
||||
|
||||
string jsonDraft = apiClient.Draft("PRD_MORPT",
|
||||
PRD_MORPTModel.CreateData(mainRow, details[0], $"{amount}", $"{famount}", moIdNo));
|
||||
}
|
||||
catch (Exception exRow)
|
||||
{
|
||||
resultText.AppendText(exRow.Message + "\r\n");
|
||||
}
|
||||
finally
|
||||
{
|
||||
StepProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
resultText.AppendText(ex.Message + "\r\n");
|
||||
}
|
||||
finally
|
||||
{
|
||||
resultText.AppendText("同步到金蝶结束!\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal SafeToDecimal(DataRow r, string col)
|
||||
{
|
||||
if (!r.Table.Columns.Contains(col)) return 0m;
|
||||
string s = $"{r[col]}";
|
||||
if (string.IsNullOrWhiteSpace(s)) return 0m;
|
||||
return Convert.ToDecimal(s);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -12,4 +12,49 @@ namespace GetApiData.KingdeeModel
|
||||
|
||||
public string FSrcEntryId { get; set; }
|
||||
|
||||
public string FIsNew { get; set; }
|
||||
|
||||
public FMaterialId FMaterialId { get; set; }
|
||||
|
||||
public string FFinishQty { get; set; }
|
||||
|
||||
public string FQuaQty { get; set; }
|
||||
|
||||
public string FProductType { get; set; }
|
||||
|
||||
public FReportType FReportType { get; set; }
|
||||
|
||||
public FWorkshipId FWorkshipId { get; set; }
|
||||
|
||||
public FLot FLot { get; set; }
|
||||
|
||||
public string FSrcBillType { get; set; }
|
||||
|
||||
public string FMoBillNo { get; set; }
|
||||
|
||||
public string FSrcBillNo { get; set; }
|
||||
|
||||
public string FSrcInterId { get; set; }
|
||||
|
||||
public string FSrcEntrySeq { get; set; }
|
||||
|
||||
public string FMoId { get; set; }
|
||||
|
||||
public string FMoEntryId { get; set; }
|
||||
|
||||
public FBomId FBomId { get; set; }
|
||||
|
||||
public string FMOMAINENTRYID { get; set; }
|
||||
|
||||
public List<PRD_MORPTFEntity_LinkItem> FEntity_Link { get; set; }
|
||||
|
||||
public FEntityItem()
|
||||
{
|
||||
FMaterialId = new FMaterialId();
|
||||
FReportType = new FReportType();
|
||||
FLot = new FLot();
|
||||
FWorkshipId = new FWorkshipId();
|
||||
FBomId = new FBomId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -50,4 +50,38 @@ namespace GetApiData.KingdeeModel
|
||||
string fEntity_Link_FRuleId = "PRD_MO2MORPT";
|
||||
string fEntity_Link_FSTableName = "T_PRD_MOENTRY";
|
||||
string fEntity_Link_FSBillId = ((billMainRow.Table.Columns.Contains("wms_mjoins_jdid") && !string.IsNullOrEmpty(string.Concat(billMainRow["wms_mjoins_jdid"]))) ? string.Concat(billMainRow["wms_mjoins_jdid"]) : "");
|
||||
string fEntity_Link_FSId = ((billDetailRow.Table.Columns.C
|
||||
string fEntity_Link_FSId = ((billDetailRow.Table.Columns.Contains("wms_ljoins_jdid") && !string.IsNullOrEmpty(string.Concat(billDetailRow["wms_ljoins_jdid"]))) ? string.Concat(billDetailRow["wms_ljoins_jdid"]) : "");
|
||||
pRD_MORPTFEntity_LinkItem.FEntity_Link_FRuleId = fEntity_Link_FRuleId;
|
||||
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSTableName = fEntity_Link_FSTableName;
|
||||
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSBillId = fEntity_Link_FSBillId;
|
||||
pRD_MORPTFEntity_LinkItem.FEntity_Link_FSId = fEntity_Link_FSId;
|
||||
list2.Add(pRD_MORPTFEntity_LinkItem);
|
||||
fEntityItem.FEntity_Link = list2;
|
||||
list.Add(fEntityItem);
|
||||
var value = new
|
||||
{
|
||||
Model = new
|
||||
{
|
||||
FBillNo = fBillNo,
|
||||
FBillType = new
|
||||
{
|
||||
FNumber = "SCHBD01_SYS"
|
||||
},
|
||||
FDate = fDate,
|
||||
FPrdOrgId = new
|
||||
{
|
||||
FNumber = "101"
|
||||
},
|
||||
FDocumentStatus = "C",
|
||||
FWorkshipIdH = new
|
||||
{
|
||||
FNumber = fNumber
|
||||
},
|
||||
FDescription = fDescription,
|
||||
FEntity = list
|
||||
}
|
||||
};
|
||||
return JsonConvert.SerializeObject(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("GetApiData")]
|
||||
[assembly: Ass
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GetApiData")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("acb19ef7-f810-43f0-8d4d-7ee615f12af1")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
+31
-1
@@ -37,4 +37,34 @@ namespace GetApiData.Properties
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager Resou
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GetApiData.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+29
-1
@@ -1 +1,29 @@
|
||||
//------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GetApiData.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-1
@@ -455,4 +455,24 @@ namespace LadfDataApp
|
||||
private System.Windows.Forms.TextBox loginNameBox;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.RadioButton radioNext;
|
||||
private System.Windows.Forms.P
|
||||
private System.Windows.Forms.Panel panelFix;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.DateTimePicker fixEndDate;
|
||||
private System.Windows.Forms.DateTimePicker fixStartDate;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.RadioButton radioFix;
|
||||
private System.Windows.Forms.Panel panelNext;
|
||||
private System.Windows.Forms.DateTimePicker nextStartDate;
|
||||
private System.Windows.Forms.Label timeUnitLab;
|
||||
private System.Windows.Forms.Label timeIntervalLab;
|
||||
private System.Windows.Forms.TextBox timeIntervalBox;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.ComboBox projectComboBox;
|
||||
private System.Windows.Forms.Button linkBtn;
|
||||
private System.Windows.Forms.Button startBtn;
|
||||
private System.Windows.Forms.CheckBox checkHistory;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -804,4 +804,42 @@ namespace LadfDataApp
|
||||
public string GetStamp(DateTime dateTime)
|
||||
{
|
||||
TimeSpan tspan = dateTime.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
return Con
|
||||
return Convert.ToInt64(tspan.TotalSeconds).ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新消息
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
private void UpdateMsg(string msg)
|
||||
{
|
||||
if (this.tipsTextBox.InvokeRequired)
|
||||
{
|
||||
this.tipsTextBox.Invoke(new Action(() =>
|
||||
{
|
||||
this.tipsTextBox.AppendText(msg);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tipsTextBox.AppendText(msg);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 清空消息
|
||||
/// </summary>
|
||||
private void ClearMsg()
|
||||
{
|
||||
if (this.tipsTextBox.InvokeRequired)
|
||||
{
|
||||
this.tipsTextBox.Invoke(new Action(() =>
|
||||
{
|
||||
this.tipsTextBox.Clear();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tipsTextBox.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,29 @@ namespace LadfDataApp
|
||||
builder.AppendFormat("{0}={1}", item.Key, item.Value);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
byteRequest = Encoding.UTF8.GetBytes(builder.ToString());
|
||||
httpWebRequest.ContentLength = byteRequest.Length;
|
||||
}
|
||||
Stream stream = httpWebRequest.GetRequestStream();
|
||||
stream.Write(byteRequest, 0, byteRequest.Length);
|
||||
stream.Close();
|
||||
|
||||
httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
|
||||
Stream responseStream = httpWebResponse.GetResponseStream();
|
||||
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
|
||||
result = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
responseStream.Close();
|
||||
|
||||
cookieCollection = cookie.GetCookies(new Uri(url));
|
||||
return httpWebResponse;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cookieCollection = null;
|
||||
return httpWebResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.T
|
||||
using System.Text;
|
||||
|
||||
namespace LadfDataApp
|
||||
{
|
||||
public class ProjectModel
|
||||
{
|
||||
public string projectId { get; set; }
|
||||
public string name { get; set; }
|
||||
public string delFlag { get; set; }
|
||||
public string province { get; set; }
|
||||
public string city { get; set; }
|
||||
public string county { get; set; }
|
||||
public string address { get; set; }
|
||||
public string propertyOwner { get; set; }
|
||||
public string constructionTime { get; set; }
|
||||
public string acreage { get; set; }
|
||||
public string typeId { get; set; }
|
||||
public string state { get; set; }
|
||||
public string enableTime { get; set; }
|
||||
public string energyConsumption { get; set; }
|
||||
public string imgUrl { get; set; }
|
||||
public string remarks { get; set; }
|
||||
public string contractor { get; set; }
|
||||
public string propertyMgmt { get; set; }
|
||||
public string projectTypeId { get; set; }
|
||||
public string projectTypeName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -6,4 +6,31 @@ using System.Runtime.InteropServices;
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("LadfDataApp")]
|
||||
[assembly: Asse
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LadfDataApp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("aa75c812-16a4-498c-bf4d-f1c2cb8e0015")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
+31
-1
@@ -37,4 +37,34 @@ namespace LadfDataApp.Properties
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager Resour
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LadfDataApp.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+29
-1
@@ -1 +1,29 @@
|
||||
//-------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace LadfDataApp.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,4 +563,31 @@ namespace LadfDataApp
|
||||
/// <param name="cmd">The command.</param>
|
||||
/// <param name="Connection">The connection.</param>
|
||||
/// <param name="trans">The trans.</param>
|
||||
|
||||
/// <param name="cmdType">Type of the command.</param>
|
||||
/// <param name="cmdText">The command text.</param>
|
||||
/// <param name="cmdParms">The command parms.</param>
|
||||
private static void PrepareCommand(SqlCommand cmd, SqlConnection Connection, SqlTransaction trans, CommandType cmdType, string cmdText, SqlParameter[] cmdParms)
|
||||
{
|
||||
if (Connection.State != ConnectionState.Open)
|
||||
{
|
||||
Connection.Open();
|
||||
}
|
||||
cmd.Connection = Connection;
|
||||
cmd.CommandTimeout = CommandTimeout;
|
||||
cmd.CommandText = cmdText;
|
||||
if (trans != null)
|
||||
{
|
||||
cmd.Transaction = trans;
|
||||
}
|
||||
cmd.CommandType = cmdType;
|
||||
if (cmdParms != null)
|
||||
{
|
||||
foreach (SqlParameter parameter in cmdParms)
|
||||
{
|
||||
cmd.Parameters.Add(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -145,4 +145,35 @@ namespace Lskj.GetSecretKey
|
||||
if (File.Exists(file))
|
||||
{
|
||||
string args = AESUtil.Decrypt(File.ReadAllText(file));
|
||||
stri
|
||||
string[] controlAfgs = args.Split('^');
|
||||
if (controlAfgs != null && controlAfgs.Length == 5)
|
||||
{
|
||||
txtServerName.Text = controlAfgs[0];
|
||||
txtDBName.Text = controlAfgs[1];
|
||||
LoginName.Text = controlAfgs[2];
|
||||
LoginPwd.Text = controlAfgs[3];
|
||||
txtDays.Text = controlAfgs[4];
|
||||
}
|
||||
}
|
||||
}
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
private void OnKeysDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
TextEdit txtEdit = (TextEdit)sender;
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
if (txtEdit.Name.Equals("LoginPwd"))
|
||||
{
|
||||
this.OnSetPanel_Click(sender, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendKeys.Send("{Tab}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,4 +74,27 @@ namespace Lskj.GetSecretKey
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(sqlNameStr);
|
||||
this.oldUserName = this.userName;
|
||||
}
|
||||
string sqlPsdStr = "ALTER LOGIN {0} WITH PASSWORD = '{1}'";
|
||||
sqlPsdStr = string.Format(sqlPsdStr, userName, passWord);
|
||||
string nConnection = "Server={0};Database={1};Persist Security Info=True;User ID=" + userName + ";Password=" + oldPassWord + ";Connection Timeout=5;MultipleActiveResultSets=true";
|
||||
nConnection = AESUtil.Encrypt(nConnection);
|
||||
SqlHelper._connection = null;
|
||||
if (DBConfig.Instance.CreateConnection(nConnection))
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(sqlPsdStr);
|
||||
this.oldPassWord = passWord;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
return;
|
||||
}
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -95,4 +95,27 @@ namespace Lskj.GetSecretKey
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(336, 113);
|
||||
this.Controls.Add(this.setPanel);
|
||||
this.Controls.Add(this.userNameEdit);
|
||||
this.Controls.Add(this.labelControl2);
|
||||
this.Controls.Add(this.passWordEidt);
|
||||
this.Controls.Add(this.labelControl1);
|
||||
this.Name = "LoginFrm";
|
||||
this.Text = "LoginFrm";
|
||||
((System.ComponentModel.ISupportInitialize)(this.userNameEdit.Properties)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.passWordEidt.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.TextEdit userNameEdit;
|
||||
private DevExpress.XtraEditors.LabelControl labelControl2;
|
||||
private DevExpress.XtraEditors.TextEdit passWordEidt;
|
||||
private DevExpress.XtraEditors.LabelControl labelControl1;
|
||||
private System.Windows.Forms.Panel setPanel;
|
||||
}
|
||||
}
|
||||
@@ -429,4 +429,25 @@ namespace Lskj.GetSecretKey
|
||||
this.ClientSize = new Size(360, 150);
|
||||
this.MaximizeBox = false; this.MinimizeBox = false;
|
||||
|
||||
var lbl = new Label { Text = "重置口令:", AutoSize = true, Location = new Point(20, 30)
|
||||
var lbl = new Label { Text = "重置口令:", AutoSize = true, Location = new Point(20, 30) };
|
||||
txtCode = new TextBox { Location = new Point(100, 26), Width = 220, UseSystemPasswordChar = true, PasswordChar = '*' };
|
||||
|
||||
btnOk = new Button { Text = "确定", DialogResult = DialogResult.OK, Location = new Point(160, 80), Width = 75 };
|
||||
btnCancel = new Button { Text = "取消", DialogResult = DialogResult.Cancel, Location = new Point(245, 80), Width = 75 };
|
||||
|
||||
btnOk.Click += (s, e) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtCode.Text))
|
||||
{
|
||||
MessageBox.Show("请输入重置口令。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
this.DialogResult = DialogResult.None; return;
|
||||
}
|
||||
ResetCode = txtCode.Text;
|
||||
};
|
||||
|
||||
this.Controls.AddRange(new System.Windows.Forms.Control[] { lbl, txtCode, btnOk, btnCancel });
|
||||
this.AcceptButton = btnOk; this.CancelButton = btnCancel;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -367,4 +367,37 @@ namespace Lskj.Main.Model
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 运行 Dev 伴侣,对其注册弹框下毒手。
|
||||
/// </summary>
|
||||
public void Run()
|
||||
{
|
||||
if (!StopCompanion)
|
||||
return; // 防止多次运行导致可能的线程错误。
|
||||
StopCompanion = false;
|
||||
m_Thread = new Thread(new ThreadStart(() =>
|
||||
{
|
||||
while (!StopCompanion)
|
||||
{
|
||||
if (ResidentMode)
|
||||
CloseAboutDev();
|
||||
else // 如果非常驻模式,则在检测并关闭Dev注册弹框后应结束程序。
|
||||
StopCompanion = CloseAboutDev();
|
||||
Thread.Sleep(Interval);
|
||||
}
|
||||
m_Thread = null;
|
||||
}));
|
||||
m_Thread.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭程序的运行。
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
StopCompanion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -20,6 +20,7 @@ using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using Lskj.Util;
|
||||
using NewMyFormDesigner;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Lskj.Core
|
||||
{
|
||||
@@ -269,33 +270,119 @@ namespace Lskj.Core
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
public bool CreateConnection(string LinkString)
|
||||
public bool CreateConnection(string LinkString, ConnectionType connectionType)
|
||||
{
|
||||
string connStr =string.IsNullOrWhiteSpace(LinkString)?GetConnection(): LinkString;
|
||||
if (SqlHelper._connection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
SqlHelper._connection.Close();
|
||||
SqlHelper._connection.Dispose();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
SqlHelper._connection = null;
|
||||
}
|
||||
|
||||
bool isConnect = false;
|
||||
try
|
||||
{
|
||||
SqlHelper._connection = new SqlConnection(connStr);
|
||||
SqlHelper._connection.Open();
|
||||
string connStr = string.IsNullOrWhiteSpace(LinkString) ? GetConnection() : LinkString;
|
||||
string providerName = "System.Data.SqlClient";
|
||||
SqlHelper.ConnectionType = ConnectionType.SqlServer;
|
||||
|
||||
return true;
|
||||
if (connectionType == ConnectionType.KdbnServer)
|
||||
{
|
||||
providerName = "Kdbndp";
|
||||
SqlHelper.ConnectionType = ConnectionType.KdbnServer;
|
||||
}
|
||||
else if (connectionType == ConnectionType.DmServer)
|
||||
{
|
||||
providerName = "Dm";
|
||||
SqlHelper.ConnectionType = ConnectionType.DmServer;
|
||||
}
|
||||
SqlHelper.dbFactory = DbProviderFactories.GetFactory(providerName);
|
||||
if (SqlHelper._connection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
SqlHelper._connection.Close();
|
||||
SqlHelper._connection.Dispose();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
SqlHelper._connection = null;
|
||||
}
|
||||
try
|
||||
{
|
||||
SqlHelper._connection = SqlHelper.dbFactory.CreateConnection();
|
||||
SqlHelper._connection.ConnectionString = connStr;
|
||||
SqlHelper._connection.Open();
|
||||
isConnect = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//throw;
|
||||
LogHelper.Instance.WriteLog(ex.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Instance.WriteLog(ex.Message);
|
||||
//throw;
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
return false;
|
||||
return isConnect;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ODBC数据源名称(DSN)获取对应的服务器地址/连接地址
|
||||
/// </summary>
|
||||
/// <param name="dsnName">ODBC数据源名称</param>
|
||||
/// <param name="isSystemDsn">是否是系统DSN(false=用户DSN)</param>
|
||||
/// <param name="is32BitOdbc">是否是32位ODBC(64位系统需指定)</param>
|
||||
/// <returns>ODBC对应的服务器地址(无则返回空)</returns>
|
||||
public string GetOdbcAddressByDsnName(string dsnName, bool isSystemDsn = true, bool is32BitOdbc = true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dsnName))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(dsnName), "ODBC数据源名称不能为空");
|
||||
}
|
||||
|
||||
// 1. 确定注册表根路径
|
||||
RegistryKey rootKey = isSystemDsn ? Registry.LocalMachine : Registry.CurrentUser;
|
||||
string odbcIniPath = "Software\\ODBC\\ODBC.INI\\" + dsnName;
|
||||
|
||||
// 64位系统下32位ODBC的路径修正
|
||||
if (isSystemDsn && is32BitOdbc && Environment.Is64BitOperatingSystem)
|
||||
{
|
||||
odbcIniPath = "Software\\WOW6432Node\\ODBC\\ODBC.INI\\" + dsnName;
|
||||
}
|
||||
|
||||
// 2. 打开注册表项并读取地址
|
||||
using (RegistryKey dsnKey = rootKey.OpenSubKey(odbcIniPath, RegistryKeyPermissionCheck.ReadSubTree))
|
||||
{
|
||||
if (dsnKey == null)
|
||||
{
|
||||
return null; // 未找到该ODBC数据源
|
||||
}
|
||||
|
||||
// 3. 优先读取常见的地址键值(不同数据库的键名可能不同)
|
||||
List<string> addressKeys = new List<string> { "Server", "Data Source", "Address", "ServerName", "DataSource" };
|
||||
foreach (string keyName in addressKeys)
|
||||
{
|
||||
string address = dsnKey.GetValue(keyName)?.ToString()?.Trim();
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
{
|
||||
return address;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 若未找到地址,返回完整连接字符串(备用)
|
||||
string connectionString = dsnKey.GetValue("ConnectString")?.ToString()?.Trim();
|
||||
return connectionString;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,5 @@
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+75
-99
@@ -135,7 +135,7 @@
|
||||
this.toolStripButton6});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(1924, 31);
|
||||
this.toolStrip1.Size = new System.Drawing.Size(1443, 27);
|
||||
this.toolStrip1.TabIndex = 0;
|
||||
this.toolStrip1.Text = "toolStrip1";
|
||||
//
|
||||
@@ -144,7 +144,7 @@
|
||||
this.toolStripButton1.Image = global::NewMyFormDesigner.Properties.Resources.Remove_16x16;
|
||||
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton1.Name = "toolStripButton1";
|
||||
this.toolStripButton1.Size = new System.Drawing.Size(63, 28);
|
||||
this.toolStripButton1.Size = new System.Drawing.Size(56, 24);
|
||||
this.toolStripButton1.Text = "删除";
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.barDelete_ItemClick);
|
||||
//
|
||||
@@ -153,7 +153,7 @@
|
||||
this.toolStripButton2.Image = global::NewMyFormDesigner.Properties.Resources.RemoveFolder_16x16;
|
||||
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton2.Name = "toolStripButton2";
|
||||
this.toolStripButton2.Size = new System.Drawing.Size(93, 28);
|
||||
this.toolStripButton2.Size = new System.Drawing.Size(80, 24);
|
||||
this.toolStripButton2.Text = "全部删除";
|
||||
this.toolStripButton2.Click += new System.EventHandler(this.barDeleteAll_ItemClick);
|
||||
//
|
||||
@@ -162,7 +162,7 @@
|
||||
this.toolStripButton3.Image = global::NewMyFormDesigner.Properties.Resources.AddFile_16x16;
|
||||
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton3.Name = "toolStripButton3";
|
||||
this.toolStripButton3.Size = new System.Drawing.Size(108, 28);
|
||||
this.toolStripButton3.Size = new System.Drawing.Size(92, 24);
|
||||
this.toolStripButton3.Text = "初始化表单";
|
||||
this.toolStripButton3.Click += new System.EventHandler(this.barButtonItem9_ItemClick);
|
||||
//
|
||||
@@ -171,7 +171,7 @@
|
||||
this.toolStripButton4.Image = global::NewMyFormDesigner.Properties.Resources.Mark_16x16;
|
||||
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton4.Name = "toolStripButton4";
|
||||
this.toolStripButton4.Size = new System.Drawing.Size(63, 28);
|
||||
this.toolStripButton4.Size = new System.Drawing.Size(56, 24);
|
||||
this.toolStripButton4.Text = "保存";
|
||||
this.toolStripButton4.Click += new System.EventHandler(this.barSave_ItemClick);
|
||||
//
|
||||
@@ -180,7 +180,7 @@
|
||||
this.toolStripButton5.Image = global::NewMyFormDesigner.Properties.Resources.Close_16x16;
|
||||
this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton5.Name = "toolStripButton5";
|
||||
this.toolStripButton5.Size = new System.Drawing.Size(63, 28);
|
||||
this.toolStripButton5.Size = new System.Drawing.Size(56, 24);
|
||||
this.toolStripButton5.Text = "退出";
|
||||
this.toolStripButton5.Click += new System.EventHandler(this.barClose_ItemClick);
|
||||
//
|
||||
@@ -189,15 +189,14 @@
|
||||
this.toolStripButton6.Image = global::NewMyFormDesigner.Properties.Resources.Other_16x16;
|
||||
this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton6.Name = "toolStripButton6";
|
||||
this.toolStripButton6.Size = new System.Drawing.Size(63, 28);
|
||||
this.toolStripButton6.Size = new System.Drawing.Size(56, 24);
|
||||
this.toolStripButton6.Text = "运行";
|
||||
this.toolStripButton6.Click += new System.EventHandler(this.barRun_ItemClick);
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 31);
|
||||
this.splitContainer1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 27);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
@@ -208,9 +207,8 @@
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.tabControl1);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1924, 739);
|
||||
this.splitContainer1.SplitterDistance = 1514;
|
||||
this.splitContainer1.SplitterWidth = 5;
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1443, 589);
|
||||
this.splitContainer1.SplitterDistance = 1135;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// plRight
|
||||
@@ -219,9 +217,8 @@
|
||||
this.plRight.Controls.Add(this.dcMain);
|
||||
this.plRight.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.plRight.Location = new System.Drawing.Point(0, 0);
|
||||
this.plRight.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.plRight.Name = "plRight";
|
||||
this.plRight.Size = new System.Drawing.Size(1514, 519);
|
||||
this.plRight.Size = new System.Drawing.Size(1135, 413);
|
||||
this.plRight.TabIndex = 4;
|
||||
//
|
||||
// dcMain
|
||||
@@ -229,19 +226,18 @@
|
||||
this.dcMain.BackColor = System.Drawing.Color.White;
|
||||
this.dcMain.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.dcMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.dcMain.Margin = new System.Windows.Forms.Padding(5);
|
||||
this.dcMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.dcMain.Name = "dcMain";
|
||||
this.dcMain.Size = new System.Drawing.Size(1493, 612);
|
||||
this.dcMain.Size = new System.Drawing.Size(1118, 490);
|
||||
this.dcMain.TabIndex = 2;
|
||||
//
|
||||
// pl_Bottom
|
||||
//
|
||||
this.pl_Bottom.Controls.Add(this.pl_PropertyGrid);
|
||||
this.pl_Bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pl_Bottom.Location = new System.Drawing.Point(0, 519);
|
||||
this.pl_Bottom.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_Bottom.Location = new System.Drawing.Point(0, 413);
|
||||
this.pl_Bottom.Name = "pl_Bottom";
|
||||
this.pl_Bottom.Size = new System.Drawing.Size(1514, 220);
|
||||
this.pl_Bottom.Size = new System.Drawing.Size(1135, 176);
|
||||
this.pl_Bottom.TabIndex = 0;
|
||||
//
|
||||
// pl_PropertyGrid
|
||||
@@ -249,9 +245,8 @@
|
||||
this.pl_PropertyGrid.Controls.Add(this.propertyGrid1);
|
||||
this.pl_PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_PropertyGrid.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_PropertyGrid.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pl_PropertyGrid.Name = "pl_PropertyGrid";
|
||||
this.pl_PropertyGrid.Size = new System.Drawing.Size(1514, 220);
|
||||
this.pl_PropertyGrid.Size = new System.Drawing.Size(1135, 176);
|
||||
this.pl_PropertyGrid.TabIndex = 2;
|
||||
//
|
||||
// propertyGrid1
|
||||
@@ -259,10 +254,9 @@
|
||||
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.propertyGrid1.HelpVisible = false;
|
||||
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
|
||||
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.propertyGrid1.Name = "propertyGrid1";
|
||||
this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical;
|
||||
this.propertyGrid1.Size = new System.Drawing.Size(1514, 220);
|
||||
this.propertyGrid1.Size = new System.Drawing.Size(1135, 176);
|
||||
this.propertyGrid1.TabIndex = 3;
|
||||
//
|
||||
// tabControl1
|
||||
@@ -271,10 +265,9 @@
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(405, 739);
|
||||
this.tabControl1.Size = new System.Drawing.Size(304, 589);
|
||||
this.tabControl1.TabIndex = 5;
|
||||
//
|
||||
// tabPage1
|
||||
@@ -282,11 +275,10 @@
|
||||
this.tabPage1.Controls.Add(this.gcFiled);
|
||||
this.tabPage1.Controls.Add(this.panel4);
|
||||
this.tabPage1.Controls.Add(this.panel2);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.tabPage1.Size = new System.Drawing.Size(397, 710);
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(296, 563);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "方案布局";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
@@ -310,15 +302,14 @@
|
||||
this.Column7});
|
||||
this.gcFiled.ContextMenuStrip = this.contextMenuStrip1;
|
||||
this.gcFiled.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcFiled.Location = new System.Drawing.Point(4, 4);
|
||||
this.gcFiled.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gcFiled.Location = new System.Drawing.Point(3, 3);
|
||||
this.gcFiled.Name = "gcFiled";
|
||||
this.gcFiled.ReadOnly = true;
|
||||
this.gcFiled.RowHeadersVisible = false;
|
||||
this.gcFiled.RowHeadersWidth = 51;
|
||||
this.gcFiled.RowTemplate.Height = 18;
|
||||
this.gcFiled.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.gcFiled.Size = new System.Drawing.Size(389, 446);
|
||||
this.gcFiled.Size = new System.Drawing.Size(290, 352);
|
||||
this.gcFiled.TabIndex = 6;
|
||||
this.gcFiled.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gvFiled_RowCellClick);
|
||||
this.gcFiled.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.gcFiled_CellPainting);
|
||||
@@ -448,73 +439,73 @@
|
||||
this.ToolStripMenuItem,
|
||||
this.SeparateColumn});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(169, 250);
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 230);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(168, 24);
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(148, 22);
|
||||
this.toolStripMenuItem1.Text = "重新生成序号";
|
||||
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(168, 24);
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(148, 22);
|
||||
this.toolStripMenuItem3.Text = "生成Tab次序";
|
||||
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
|
||||
//
|
||||
// ToolStripMenuItem4
|
||||
//
|
||||
this.ToolStripMenuItem4.Name = "ToolStripMenuItem4";
|
||||
this.ToolStripMenuItem4.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItem4.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItem4.Text = "整栏选中";
|
||||
this.ToolStripMenuItem4.Click += new System.EventHandler(this.ToolStripMenuItem4_Click);
|
||||
//
|
||||
// ToolStripMenuItemJql
|
||||
//
|
||||
this.ToolStripMenuItemJql.Name = "ToolStripMenuItemJql";
|
||||
this.ToolStripMenuItemJql.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItemJql.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItemJql.Text = "精确列选中";
|
||||
this.ToolStripMenuItemJql.Click += new System.EventHandler(this.ToolStripMenuItemJql_Click);
|
||||
//
|
||||
// ToolStripMenuItemCyl
|
||||
//
|
||||
this.ToolStripMenuItemCyl.Name = "ToolStripMenuItemCyl";
|
||||
this.ToolStripMenuItemCyl.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItemCyl.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItemCyl.Text = "差异列选中";
|
||||
this.ToolStripMenuItemCyl.Click += new System.EventHandler(this.ToolStripMenuItemCyl_Click);
|
||||
//
|
||||
// ToolStripMenuItemJqh
|
||||
//
|
||||
this.ToolStripMenuItemJqh.Name = "ToolStripMenuItemJqh";
|
||||
this.ToolStripMenuItemJqh.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItemJqh.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItemJqh.Text = "精确行选中";
|
||||
this.ToolStripMenuItemJqh.Click += new System.EventHandler(this.ToolStripMenuItemJqh_Click);
|
||||
//
|
||||
// ToolStripMenuItemCyh
|
||||
//
|
||||
this.ToolStripMenuItemCyh.Name = "ToolStripMenuItemCyh";
|
||||
this.ToolStripMenuItemCyh.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItemCyh.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItemCyh.Text = "差异行选中";
|
||||
this.ToolStripMenuItemCyh.Click += new System.EventHandler(this.ToolStripMenuItemCyh_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(165, 6);
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(145, 6);
|
||||
//
|
||||
// ToolStripMenuItemSzlm
|
||||
//
|
||||
this.ToolStripMenuItemSzlm.Name = "ToolStripMenuItemSzlm";
|
||||
this.ToolStripMenuItemSzlm.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItemSzlm.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItemSzlm.Text = "生成布局";
|
||||
this.ToolStripMenuItemSzlm.Click += new System.EventHandler(this.ToolStripMenuItemSzlm_Click);
|
||||
//
|
||||
// ToolStripMenuItem
|
||||
//
|
||||
this.ToolStripMenuItem.Name = "ToolStripMenuItem";
|
||||
this.ToolStripMenuItem.Size = new System.Drawing.Size(168, 24);
|
||||
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
|
||||
this.ToolStripMenuItem.Text = "分组框多选";
|
||||
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -527,13 +518,13 @@
|
||||
this.四栏ToolStripMenuItem,
|
||||
this.五栏ToolStripMenuItem});
|
||||
this.SeparateColumn.Name = "SeparateColumn";
|
||||
this.SeparateColumn.Size = new System.Drawing.Size(168, 24);
|
||||
this.SeparateColumn.Size = new System.Drawing.Size(148, 22);
|
||||
this.SeparateColumn.Text = "分栏";
|
||||
//
|
||||
// 一栏ToolStripMenuItem
|
||||
//
|
||||
this.一栏ToolStripMenuItem.Name = "一栏ToolStripMenuItem";
|
||||
this.一栏ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
|
||||
this.一栏ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
|
||||
this.一栏ToolStripMenuItem.Tag = "1";
|
||||
this.一栏ToolStripMenuItem.Text = "一栏";
|
||||
this.一栏ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
|
||||
@@ -541,7 +532,7 @@
|
||||
// 二栏ToolStripMenuItem
|
||||
//
|
||||
this.二栏ToolStripMenuItem.Name = "二栏ToolStripMenuItem";
|
||||
this.二栏ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
|
||||
this.二栏ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
|
||||
this.二栏ToolStripMenuItem.Tag = "2";
|
||||
this.二栏ToolStripMenuItem.Text = "二栏";
|
||||
this.二栏ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
|
||||
@@ -549,7 +540,7 @@
|
||||
// 三栏ToolStripMenuItem
|
||||
//
|
||||
this.三栏ToolStripMenuItem.Name = "三栏ToolStripMenuItem";
|
||||
this.三栏ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
|
||||
this.三栏ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
|
||||
this.三栏ToolStripMenuItem.Tag = "3";
|
||||
this.三栏ToolStripMenuItem.Text = "三栏";
|
||||
this.三栏ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
|
||||
@@ -557,7 +548,7 @@
|
||||
// 四栏ToolStripMenuItem
|
||||
//
|
||||
this.四栏ToolStripMenuItem.Name = "四栏ToolStripMenuItem";
|
||||
this.四栏ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
|
||||
this.四栏ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
|
||||
this.四栏ToolStripMenuItem.Tag = "4";
|
||||
this.四栏ToolStripMenuItem.Text = "四栏";
|
||||
this.四栏ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
|
||||
@@ -565,7 +556,7 @@
|
||||
// 五栏ToolStripMenuItem
|
||||
//
|
||||
this.五栏ToolStripMenuItem.Name = "五栏ToolStripMenuItem";
|
||||
this.五栏ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
|
||||
this.五栏ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
|
||||
this.五栏ToolStripMenuItem.Tag = "5";
|
||||
this.五栏ToolStripMenuItem.Text = "五栏";
|
||||
this.五栏ToolStripMenuItem.Click += new System.EventHandler(this.OnSeparateColumn);
|
||||
@@ -580,19 +571,17 @@
|
||||
this.panel4.Controls.Add(this.comboBox1);
|
||||
this.panel4.Controls.Add(this.label1);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel4.Location = new System.Drawing.Point(4, 450);
|
||||
this.panel4.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.panel4.Location = new System.Drawing.Point(3, 355);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(389, 50);
|
||||
this.panel4.Size = new System.Drawing.Size(290, 40);
|
||||
this.panel4.TabIndex = 5;
|
||||
//
|
||||
// btn_design
|
||||
//
|
||||
this.btn_design.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btn_design.Location = new System.Drawing.Point(292, 9);
|
||||
this.btn_design.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btn_design.Location = new System.Drawing.Point(217, 7);
|
||||
this.btn_design.Name = "btn_design";
|
||||
this.btn_design.Size = new System.Drawing.Size(91, 31);
|
||||
this.btn_design.Size = new System.Drawing.Size(68, 25);
|
||||
this.btn_design.TabIndex = 0;
|
||||
this.btn_design.Text = "调整";
|
||||
this.btn_design.UseVisualStyleBackColor = true;
|
||||
@@ -600,8 +589,7 @@
|
||||
//
|
||||
// numericUpDown1
|
||||
//
|
||||
this.numericUpDown1.Location = new System.Drawing.Point(411, 12);
|
||||
this.numericUpDown1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.numericUpDown1.Location = new System.Drawing.Point(308, 10);
|
||||
this.numericUpDown1.Maximum = new decimal(new int[] {
|
||||
8000,
|
||||
0,
|
||||
@@ -613,16 +601,15 @@
|
||||
0,
|
||||
-2147483648});
|
||||
this.numericUpDown1.Name = "numericUpDown1";
|
||||
this.numericUpDown1.Size = new System.Drawing.Size(56, 25);
|
||||
this.numericUpDown1.Size = new System.Drawing.Size(42, 21);
|
||||
this.numericUpDown1.TabIndex = 8;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(353, 18);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Location = new System.Drawing.Point(265, 14);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(52, 15);
|
||||
this.label3.Size = new System.Drawing.Size(41, 12);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "调整值";
|
||||
//
|
||||
@@ -637,19 +624,17 @@
|
||||
"宽",
|
||||
"高",
|
||||
"栏目"});
|
||||
this.comboBox2.Location = new System.Drawing.Point(284, 12);
|
||||
this.comboBox2.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.comboBox2.Location = new System.Drawing.Point(213, 10);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(60, 23);
|
||||
this.comboBox2.Size = new System.Drawing.Size(46, 20);
|
||||
this.comboBox2.TabIndex = 5;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(211, 18);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label2.Location = new System.Drawing.Point(158, 14);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(67, 15);
|
||||
this.label2.Size = new System.Drawing.Size(53, 12);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "调整属性";
|
||||
//
|
||||
@@ -661,19 +646,17 @@
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"同值",
|
||||
"增减"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(131, 12);
|
||||
this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.comboBox1.Location = new System.Drawing.Point(98, 10);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(64, 23);
|
||||
this.comboBox1.Size = new System.Drawing.Size(49, 20);
|
||||
this.comboBox1.TabIndex = 3;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(7, 16);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Location = new System.Drawing.Point(5, 13);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(113, 15);
|
||||
this.label1.Size = new System.Drawing.Size(89, 12);
|
||||
this.label1.TabIndex = 2;
|
||||
this.label1.Text = "批量调整 类型";
|
||||
//
|
||||
@@ -682,10 +665,9 @@
|
||||
this.panel2.Controls.Add(this.gridControl1);
|
||||
this.panel2.Controls.Add(this.panel3);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel2.Location = new System.Drawing.Point(4, 500);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.panel2.Location = new System.Drawing.Point(3, 395);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(389, 206);
|
||||
this.panel2.Size = new System.Drawing.Size(290, 165);
|
||||
this.panel2.TabIndex = 4;
|
||||
//
|
||||
// gridControl1
|
||||
@@ -702,12 +684,11 @@
|
||||
this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridControl1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
|
||||
this.gridControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.gridControl1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gridControl1.Name = "gridControl1";
|
||||
this.gridControl1.RowHeadersVisible = false;
|
||||
this.gridControl1.RowHeadersWidth = 51;
|
||||
this.gridControl1.RowTemplate.Height = 18;
|
||||
this.gridControl1.Size = new System.Drawing.Size(389, 157);
|
||||
this.gridControl1.Size = new System.Drawing.Size(290, 126);
|
||||
this.gridControl1.TabIndex = 7;
|
||||
//
|
||||
// 栏目ID
|
||||
@@ -764,18 +745,16 @@
|
||||
this.panel3.Controls.Add(this.simpleButton2);
|
||||
this.panel3.Controls.Add(this.simpleButton1);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 157);
|
||||
this.panel3.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.panel3.Location = new System.Drawing.Point(0, 126);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(389, 49);
|
||||
this.panel3.Size = new System.Drawing.Size(290, 39);
|
||||
this.panel3.TabIndex = 1;
|
||||
//
|
||||
// simpleButton3
|
||||
//
|
||||
this.simpleButton3.Location = new System.Drawing.Point(201, 10);
|
||||
this.simpleButton3.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.simpleButton3.Location = new System.Drawing.Point(151, 8);
|
||||
this.simpleButton3.Name = "simpleButton3";
|
||||
this.simpleButton3.Size = new System.Drawing.Size(91, 31);
|
||||
this.simpleButton3.Size = new System.Drawing.Size(68, 25);
|
||||
this.simpleButton3.TabIndex = 0;
|
||||
this.simpleButton3.Text = "执行方案";
|
||||
this.simpleButton3.UseVisualStyleBackColor = true;
|
||||
@@ -783,10 +762,9 @@
|
||||
//
|
||||
// simpleButton2
|
||||
//
|
||||
this.simpleButton2.Location = new System.Drawing.Point(103, 10);
|
||||
this.simpleButton2.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.simpleButton2.Location = new System.Drawing.Point(77, 8);
|
||||
this.simpleButton2.Name = "simpleButton2";
|
||||
this.simpleButton2.Size = new System.Drawing.Size(91, 31);
|
||||
this.simpleButton2.Size = new System.Drawing.Size(68, 25);
|
||||
this.simpleButton2.TabIndex = 0;
|
||||
this.simpleButton2.Text = "删除";
|
||||
this.simpleButton2.UseVisualStyleBackColor = true;
|
||||
@@ -794,10 +772,9 @@
|
||||
//
|
||||
// simpleButton1
|
||||
//
|
||||
this.simpleButton1.Location = new System.Drawing.Point(4, 10);
|
||||
this.simpleButton1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.simpleButton1.Location = new System.Drawing.Point(3, 8);
|
||||
this.simpleButton1.Name = "simpleButton1";
|
||||
this.simpleButton1.Size = new System.Drawing.Size(91, 31);
|
||||
this.simpleButton1.Size = new System.Drawing.Size(68, 25);
|
||||
this.simpleButton1.TabIndex = 0;
|
||||
this.simpleButton1.Text = "增加";
|
||||
this.simpleButton1.UseVisualStyleBackColor = true;
|
||||
@@ -806,10 +783,11 @@
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.gcGroup);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(397, 710);
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tabPage2.Size = new System.Drawing.Size(296, 563);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "标签设置";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
@@ -823,12 +801,11 @@
|
||||
this.Column20,
|
||||
this.Column21});
|
||||
this.gcGroup.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcGroup.Location = new System.Drawing.Point(3, 3);
|
||||
this.gcGroup.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gcGroup.Location = new System.Drawing.Point(2, 2);
|
||||
this.gcGroup.Name = "gcGroup";
|
||||
this.gcGroup.RowHeadersWidth = 51;
|
||||
this.gcGroup.RowTemplate.Height = 27;
|
||||
this.gcGroup.Size = new System.Drawing.Size(391, 704);
|
||||
this.gcGroup.Size = new System.Drawing.Size(292, 559);
|
||||
this.gcGroup.TabIndex = 0;
|
||||
//
|
||||
// Column18
|
||||
@@ -865,13 +842,12 @@
|
||||
//
|
||||
// MyFormDesigner
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1924, 770);
|
||||
this.ClientSize = new System.Drawing.Size(1443, 616);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.toolStrip1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "MyFormDesigner";
|
||||
this.Text = "Form1";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace NewMyFormDesigner
|
||||
/// 密码
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
//模块类别,1=单表,2=单据
|
||||
public int Modtype { get; set; }
|
||||
|
||||
|
||||
public DesignerControl dc { get; set; }
|
||||
@@ -62,26 +64,53 @@ namespace NewMyFormDesigner
|
||||
this.gridControl1.AutoGenerateColumns = false;
|
||||
|
||||
string LinkString = string.Empty;
|
||||
ConnectionType connectionType = ConnectionType.SqlServer;
|
||||
if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber) && !string.IsNullOrWhiteSpace(Password))
|
||||
{
|
||||
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true",ServerName, DatabaseName, AccountNumber, Password);
|
||||
LinkString = string.Format("Server ={0}; Database ={1}; Persist Security Info = True; User ID ={2}; Password ={3}; Connection Timeout = 5; MultipleActiveResultSets = true", ServerName, DatabaseName, AccountNumber, Password);
|
||||
}
|
||||
|
||||
if (DBConfig.Instance.CreateConnection(LinkString))
|
||||
|
||||
//DialogResult dr = MessageBox.Show("是否为达梦数据库?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
//if (dr == System.Windows.Forms.DialogResult.Yes)
|
||||
//{
|
||||
// if (!string.IsNullOrWhiteSpace(ServerName) && !string.IsNullOrWhiteSpace(DatabaseName) && !string.IsNullOrWhiteSpace(AccountNumber))
|
||||
// {
|
||||
// string connect = "Nzg5REZBQ0IzMjYzQkQzRTZFRTExNjY5MThCNjUwQTVFRUQyMDMxQzI5REIwODY5REIwMkVCQzQ4MTMzRDhDNEU1N0JFREI0MDM3MTQ1MDZGQzdGOEQxQTE4MkQ2QzgyNEE4RkMzRDQzQUM4MzgyOEQ2REZERTIzQzBDMjJGQUE=";
|
||||
// string hostname = Environment.MachineName;
|
||||
// if (!string.IsNullOrWhiteSpace(Password))
|
||||
// {
|
||||
// LinkString = string.Format("Server={0}; schema={1}; UserId={2}; PWD={3};host={4}", ServerName, DatabaseName, AccountNumber, Password, hostname);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LinkString = string.Format(Lskj.Util.AESUtil.Decrypt(connect), ServerName, DatabaseName, AccountNumber, hostname);
|
||||
// }
|
||||
// connectionType = ConnectionType.DmServer;
|
||||
// }
|
||||
//}
|
||||
//MessageBox.Show(LinkString);
|
||||
|
||||
|
||||
if (DBConfig.Instance.CreateConnection(LinkString, connectionType))
|
||||
{
|
||||
//MessageBox.Show("1");
|
||||
InitData();
|
||||
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemDlltab where formkey='{0}'", FrmKey));
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
this.DllCoid = dt.Rows[0]["DllCoid"] + "";
|
||||
this.Modtype = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systembilltype where formkey='{0}'", FrmKey));
|
||||
if(dt.Rows.Count>0) this.DllCoid = dt.Rows[0]["typeCode"] + "";
|
||||
this.Modtype = 2;
|
||||
}
|
||||
|
||||
}
|
||||
//MessageBox.Show("2");
|
||||
}
|
||||
|
||||
|
||||
@@ -194,10 +223,11 @@ namespace NewMyFormDesigner
|
||||
dc.Height = pModel.parentHeight;
|
||||
dc.Width = pModel.parentWidth;
|
||||
dc.AutoScroll = true;
|
||||
plRight.Controls.Add(dc);
|
||||
dc.Dock = DockStyle.Fill;
|
||||
plRight.AutoScroll = true;
|
||||
|
||||
plRight.Controls.Add(dc);
|
||||
|
||||
plRight.AutoScroll = true;
|
||||
dc.BringToFront();
|
||||
}
|
||||
|
||||
@@ -224,7 +254,7 @@ namespace NewMyFormDesigner
|
||||
ctr.Location = (new Point(posX, posY));//屏幕坐标转换成控件容器坐标
|
||||
ctr.Width = width;
|
||||
ctr.Height = height;
|
||||
ctr.TabIndex = tabOrder;
|
||||
ctr.TabIndex = tabOrder>=0? tabOrder:0;
|
||||
|
||||
ctr.Tag = new object[] { fieldid, username, fieldtypeid, fieldname, defaultValue, column_id, orderid, id };
|
||||
ctr.Parent = dc._hostFrame;
|
||||
@@ -286,6 +316,8 @@ namespace NewMyFormDesigner
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void gvFiled_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button != MouseButtons.Left)
|
||||
@@ -344,6 +376,7 @@ namespace NewMyFormDesigner
|
||||
RunForm runForm = new RunForm();
|
||||
runForm.FrmKey = FrmKey;
|
||||
runForm.DllCoid = DllCoid;
|
||||
runForm.Modtype = Modtype;
|
||||
//runForm.db = db;
|
||||
runForm.SQL = SelectSQL;
|
||||
runForm.ShowDialog();
|
||||
@@ -363,11 +396,11 @@ namespace NewMyFormDesigner
|
||||
DataTable formTheKey = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemControlParent where formkey='{0}'", FrmKey));
|
||||
if (formTheKey != null && formTheKey.Rows.Count > 0) //数据库中是否有这个模块
|
||||
{
|
||||
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "'";
|
||||
sql = " UPDATE p_systemControlParent set parentheight='" + dc._hostFrame.Height.ToString() + "',parentwidth='" + dc._hostFrame.Width.ToString() + "'where formkey='" + FrmKey + "';";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ")";
|
||||
sql = " insert into p_systemControlParent (formkey,parentheight,parentwidth) values ('" + FrmKey + "'," + dc._hostFrame.Height.ToString() + "," + dc._hostFrame.Width.ToString() + ");";
|
||||
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
@@ -379,7 +412,7 @@ namespace NewMyFormDesigner
|
||||
dtColumn.AcceptChanges();
|
||||
if ((dtColumn != null) && (dtColumn.Rows.Count > 0))
|
||||
{
|
||||
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "'";
|
||||
sql = " delete p_systemcontrolColumn where formkey='" + FrmKey + "';";
|
||||
sqlbuild.Append(sql);
|
||||
foreach (DataRow row in dtColumn.Rows)
|
||||
{
|
||||
@@ -390,7 +423,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
|
||||
,'{6}');", FrmKey, row["column_id"], row["controlLeft"], row["controlTop"], row["controlWidth"], row["controlHeight"], row["rowspace"]);
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
}
|
||||
@@ -445,7 +478,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +491,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}'
|
||||
,[controlType]='{6}',[borderColor]='{8}',[titlePosition]='{9}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid, colorHtml, TitlePosition) :
|
||||
String.Format(@"UPDATE p_systemAddGroup set
|
||||
[GroupName]='{0}'
|
||||
@@ -467,7 +500,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, cid);
|
||||
}
|
||||
else
|
||||
@@ -487,7 +520,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}','{7}','{8}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
|
||||
,'{6}','{7}','{8}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333, colorHtml, TitlePosition) :
|
||||
String.Format(@"INSERT INTO [p_systemAddGroup]
|
||||
([GroupName]
|
||||
,[controlLeft]
|
||||
@@ -503,7 +536,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 333);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
@@ -518,7 +551,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
@@ -530,7 +563,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332, cid);
|
||||
}
|
||||
else
|
||||
@@ -550,7 +583,7 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 332);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
@@ -565,7 +598,7 @@ namespace NewMyFormDesigner
|
||||
cid = col[7].ToString();//当前控件的id
|
||||
if (IsNumberic(cid))
|
||||
{
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}'", cid));
|
||||
dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemAddGroup where id='{0}';", cid));
|
||||
}
|
||||
}
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
@@ -577,7 +610,7 @@ namespace NewMyFormDesigner
|
||||
,[controlHeight]='{3}'
|
||||
,[controlWidth]='{4}'
|
||||
,[formKey]='{5}'
|
||||
,[controlType]='{6}' where id='{7}'
|
||||
,[controlType]='{6}' where id='{7}';
|
||||
", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334, cid);
|
||||
}
|
||||
else
|
||||
@@ -597,14 +630,14 @@ namespace NewMyFormDesigner
|
||||
,'{3}'
|
||||
,'{4}'
|
||||
,'{5}'
|
||||
,'{6}')", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
|
||||
,'{6}');", c.Text, c.Left, c.Top, c.Height, c.Width, FrmKey, 334);
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}'", FrmKey));
|
||||
sqlbuild.Append(string.Format(" delete p_systemControlLocation where formkey='{0}';", FrmKey));
|
||||
foreach (DataRow row in dtFiled.Rows)
|
||||
{
|
||||
//MessageBox.Show(row["fieldName"].ToString());
|
||||
@@ -623,7 +656,7 @@ namespace NewMyFormDesigner
|
||||
if (tags.Length >= 9)
|
||||
{
|
||||
ControlProperty controlProperty = tags[tags.Length - 1] as ControlProperty;
|
||||
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}'", FrmKey, controlProperty.GroupName);
|
||||
String group_sql = string.Format("select * from p_systemAddGroup where formkey='{0}' and groupName='{1}';", FrmKey, controlProperty.GroupName);
|
||||
DataTable dtsql = SqlHelper.ExecuteDataSet(group_sql).Tables[0];
|
||||
if (dtsql != null && dtsql.Rows.Count > 0)
|
||||
{
|
||||
@@ -678,7 +711,7 @@ namespace NewMyFormDesigner
|
||||
model.GroupId.ToString() + "," +
|
||||
ctr.TabIndex.ToString() + "," +
|
||||
tags[5].ToString() + "," +
|
||||
tags[6].ToString() + ")";
|
||||
tags[6].ToString() + ");";
|
||||
sqlbuild.Append(sql);
|
||||
//ldao.Add(model);
|
||||
}
|
||||
@@ -689,14 +722,16 @@ namespace NewMyFormDesigner
|
||||
MessageBox.Show(row["username"].ToString());
|
||||
}
|
||||
|
||||
sqlbuild.Append(updateSQL);
|
||||
//sqlbuild.Append(updateSQL);
|
||||
}
|
||||
sqlbuild.Append(updateSQL);
|
||||
SqlHelper.ExecuteNonQuery(sqlbuild.ToString());
|
||||
MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
System.Windows.Forms.Clipboard.SetText(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -760,11 +795,11 @@ namespace NewMyFormDesigner
|
||||
StringBuilder sqlbuild = new StringBuilder();
|
||||
if (dc._overlayer._currentCtrl is LabelGroupBox || dc._overlayer._currentCtrl is Panel || dc._overlayer._currentCtrl is LabelDivider)
|
||||
{
|
||||
sql = "delete from p_systemAddGroup where id='" + id + "'";
|
||||
sql = "delete from p_systemAddGroup where id='" + id + "';";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "delete from p_systemcontrollocation where id='" + id + "'";
|
||||
sql = "delete from p_systemcontrollocation where id='" + id + "';";
|
||||
}
|
||||
sqlbuild.Append(sql);
|
||||
sqlbuild.Append(updateSQL);
|
||||
@@ -1335,6 +1370,8 @@ namespace NewMyFormDesigner
|
||||
DialogResult dlrg = MessageBox.Show("是否对全部控件的Tab进行批量调整?", "询问", MessageBoxButtons.YesNo);
|
||||
if (dlrg != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
//int value = 1;
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
if (dr == null)
|
||||
@@ -1350,7 +1387,6 @@ namespace NewMyFormDesigner
|
||||
continue;
|
||||
}
|
||||
ctr[0].TabIndex = value;
|
||||
|
||||
//点击保存时去修改
|
||||
//try
|
||||
//{
|
||||
|
||||
@@ -35,9 +35,16 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<Reference Include="DM.DmProvider, Version=8.3.1.34394, Culture=neutral, PublicKeyToken=7a2d44aa446c6d01, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\..\引用DLL\DM.DmProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kdbndp, Version=8.6.1.1, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Kdbndp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Newtonsoft.Json.6.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -173,6 +180,7 @@
|
||||
<None Include="app.config" />
|
||||
<None Include="obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache" />
|
||||
<None Include="obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace NewMyFormDesigner
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>{FB58ED9E-DD23-4CD9-98AB-4059609ADB87}
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
@@ -20,21 +20,22 @@ namespace NewMyFormDesigner
|
||||
try
|
||||
{
|
||||
MyFormDesigner myFormDesigner = new MyFormDesigner();
|
||||
//myFormDesigner.FrmKey = "{80d30957-bca9-4ad4-8cf6-2e947e92b89b}";
|
||||
|
||||
//myFormDesigner.FrmKey = "{83184D92-F406-487E-9110-2CB991BFA817}";//B32C9D6E-EB85-4CE1-9B81-2B22EDF2D125 56F43621-6C15-4BDD-8870-98D235ECAB91
|
||||
|
||||
//myFormDesigner.SelectSQL = @"select b.orderid,b.id as fieldid,fieldname,username1 as username,
|
||||
// fieldsqltag as fieldtypeid,defaultdate as defaultValue
|
||||
// from p_systemDlltab a
|
||||
// left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='{80d30957-bca9-4ad4-8cf6-2e947e92b89b}' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
|
||||
// left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='{83184D92-F406-487E-9110-2CB991BFA817}' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
|
||||
|
||||
//myFormDesigner.updateSQL = @"update p_systemwordbooktab set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder from p_systemControlLocation b where p_systemwordbooktab.formKey=b.formKey and p_systemwordbooktab.id=b.fieldId and b.formkey='{80d30957-bca9-4ad4-8cf6-2e947e92b89b}'";
|
||||
//myFormDesigner.updateSQL = @"update p_systemwordbooktab set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder from p_systemControlLocation b where p_systemwordbooktab.formKey=b.formKey and p_systemwordbooktab.id=b.fieldId and b.formkey='{83184D92-F406-487E-9110-2CB991BFA817}'";
|
||||
|
||||
|
||||
|
||||
//myFormDesigner.ServerName = "222.209.207.65,37892";
|
||||
//myFormDesigner.DatabaseName = "lserp_xdsy";
|
||||
//myFormDesigner.ServerName = "110.185.161.104:5236";
|
||||
//myFormDesigner.DatabaseName = "LSERP_JTCS";
|
||||
//myFormDesigner.AccountNumber = "lserpAdmin";
|
||||
//myFormDesigner.Password = "";//XDerp20210411%
|
||||
//myFormDesigner.Password = "DWlserp1101";//XDerp20210411%
|
||||
|
||||
//MessageBox.Show(args.Length + "");
|
||||
//MessageBox.Show(args[0]);
|
||||
@@ -74,7 +75,6 @@ namespace NewMyFormDesigner
|
||||
fieldsqltag as fieldtypeid,defaultdate as defaultValue
|
||||
from p_systemDlltab a
|
||||
left join p_systemwordbooktab b on a.DllCoid=b.tab where a.formkey='" + myFormDesigner.FrmKey + "' and fieldsqltag<>3 and username1 is not null and isnull(addVisible,0)=0";
|
||||
|
||||
myFormDesigner.updateSQL = @"update p_systemwordbooktab set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder
|
||||
from p_systemControlLocation b where p_systemwordbooktab.formKey=b.formKey and p_systemwordbooktab.id=b.fieldId and b.formkey='" + myFormDesigner.FrmKey + "'";
|
||||
}
|
||||
@@ -85,7 +85,6 @@ namespace NewMyFormDesigner
|
||||
fieldTypeId as fieldtypeid,defaultValue as defaultValue
|
||||
from p_systembilltype a
|
||||
left join P_systembillinfo b on a.typecode=b.typecode where a.formkey='" + myFormDesigner.FrmKey + "' and fieldTypeId<>3 and userName is not null";
|
||||
|
||||
myFormDesigner.updateSQL = @"update P_systembillinfo set controlleft=b.controlleft ,controlTop=b.controlTop, controlHeight=b.controlHeight,controlWidth=b.controlWidth, tabOrder=b.tabOrder
|
||||
from p_systemControlLocation b where P_systembillinfo.formKey=b.formKey and P_systembillinfo.id=b.fieldId and b.formkey='" + myFormDesigner.FrmKey + "'";
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace NewMyFormDesigner
|
||||
public string FrmKey { get; set; }
|
||||
public string SQL { get; set; }
|
||||
public string DllCoid { get; set; }
|
||||
public int Modtype { get; set; }
|
||||
|
||||
|
||||
|
||||
public RunForm()
|
||||
@@ -72,13 +74,15 @@ namespace NewMyFormDesigner
|
||||
SqlParameter[] param =
|
||||
{
|
||||
new SqlParameter("@modid",SqlDbType.VarChar,100),
|
||||
new SqlParameter("@modtype",SqlDbType.Int),
|
||||
new SqlParameter("@operType",SqlDbType.Int),
|
||||
pMsg,
|
||||
returnValue
|
||||
};
|
||||
param[0].Value = modid;
|
||||
param[1].Value = operType;
|
||||
param[2].Value = "";
|
||||
param[1].Value = Modtype;
|
||||
param[2].Value = operType;
|
||||
param[3].Value = "";
|
||||
SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "[P_System_AUTOCreateMod]", param);
|
||||
msg = pMsg.Value + "";
|
||||
return Convert.ToInt32(returnValue.Value.ToString());
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<add name="KingbaseES"
|
||||
invariant="Kdbndp"
|
||||
description="KingbaseES Database Provider"
|
||||
type="Kdbndp.KdbndpFactory, Kdbndp, Version=8.6.1.1, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
|
||||
<add name="DM Data Provider"
|
||||
invariant="Dm"
|
||||
description="DM .Net Framework Data Provider"
|
||||
type="Dm.DmClientFactory, DM.DmProvider, Version=8.3.1.34394, Culture=neutral, PublicKeyToken=7a2d44aa446c6d01"/>
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
</configuration>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net40" />
|
||||
</packages>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,963 @@
|
||||
# Redis configuration file example
|
||||
|
||||
# Note on units: when memory size is needed, it is possible to specify
|
||||
# it in the usual form of 1k 5GB 4M and so forth:
|
||||
#
|
||||
# 1k => 1000 bytes
|
||||
# 1kb => 1024 bytes
|
||||
# 1m => 1000000 bytes
|
||||
# 1mb => 1024*1024 bytes
|
||||
# 1g => 1000000000 bytes
|
||||
# 1gb => 1024*1024*1024 bytes
|
||||
#
|
||||
# units are case insensitive so 1GB 1Gb 1gB are all the same.
|
||||
|
||||
################################## INCLUDES ###################################
|
||||
|
||||
# Include one or more other config files here. This is useful if you
|
||||
# have a standard template that goes to all Redis servers but also need
|
||||
# to customize a few per-server settings. Include files can include
|
||||
# other files, so use this wisely.
|
||||
#
|
||||
# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
|
||||
# from admin or Redis Sentinel. Since Redis always uses the last processed
|
||||
# line as value of a configuration directive, you'd better put includes
|
||||
# at the beginning of this file to avoid overwriting config change at runtime.
|
||||
#
|
||||
# If instead you are interested in using includes to override configuration
|
||||
# options, it is better to use include as the last line.
|
||||
#
|
||||
# include .\path\to\local.conf
|
||||
# include c:\path\to\other.conf
|
||||
|
||||
################################ GENERAL #####################################
|
||||
|
||||
# On Windows, daemonize and pidfile are not supported.
|
||||
# However, you can run redis as a Windows service, and specify a logfile.
|
||||
# The logfile will contain the pid.
|
||||
|
||||
# Accept connections on the specified port, default is 6379.
|
||||
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||
port 6379
|
||||
|
||||
# TCP listen() backlog.
|
||||
#
|
||||
# In high requests-per-second environments you need an high backlog in order
|
||||
# to avoid slow clients connections issues. Note that the Linux kernel
|
||||
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
|
||||
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
|
||||
# in order to get the desired effect.
|
||||
tcp-backlog 511
|
||||
|
||||
# By default Redis listens for connections from all the network interfaces
|
||||
# available on the server. It is possible to listen to just one or multiple
|
||||
# interfaces using the "bind" configuration directive, followed by one or
|
||||
# more IP addresses.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# bind 192.168.1.100 10.0.0.1
|
||||
# bind 127.0.0.1
|
||||
|
||||
|
||||
# Specify the path for the Unix socket that will be used to listen for
|
||||
# incoming connections. There is no default, so Redis will not listen
|
||||
# on a unix socket when not specified.
|
||||
#
|
||||
# unixsocket /tmp/redis.sock
|
||||
# unixsocketperm 700
|
||||
|
||||
# Close the connection after a client is idle for N seconds (0 to disable)
|
||||
timeout 0
|
||||
|
||||
# TCP keepalive.
|
||||
#
|
||||
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
|
||||
# of communication. This is useful for two reasons:
|
||||
#
|
||||
# 1) Detect dead peers.
|
||||
# 2) Take the connection alive from the point of view of network
|
||||
# equipment in the middle.
|
||||
#
|
||||
# On Linux, the specified value (in seconds) is the period used to send ACKs.
|
||||
# Note that to close the connection the double of the time is needed.
|
||||
# On other kernels the period depends on the kernel configuration.
|
||||
#
|
||||
# A reasonable value for this option is 60 seconds.
|
||||
tcp-keepalive 0
|
||||
|
||||
# Specify the server verbosity level.
|
||||
# This can be one of:
|
||||
# debug (a lot of information, useful for development/testing)
|
||||
# verbose (many rarely useful info, but not a mess like the debug level)
|
||||
# notice (moderately verbose, what you want in production probably)
|
||||
# warning (only very important / critical messages are logged)
|
||||
loglevel notice
|
||||
|
||||
# Specify the log file name. Also 'stdout' can be used to force
|
||||
# Redis to log on the standard output.
|
||||
logfile "Logs/redis_log.txt"
|
||||
|
||||
# To enable logging to the Windows EventLog, just set 'syslog-enabled' to
|
||||
# yes, and optionally update the other syslog parameters to suit your needs.
|
||||
# If Redis is installed and launched as a Windows Service, this will
|
||||
# automatically be enabled.
|
||||
syslog-enabled yes
|
||||
|
||||
# Specify the source name of the events in the Windows Application log.
|
||||
syslog-ident redis
|
||||
|
||||
# Set the number of databases. The default database is DB 0, you can select
|
||||
# a different one on a per-connection basis using SELECT <dbid> where
|
||||
# dbid is a number between 0 and 'databases'-1
|
||||
databases 16
|
||||
|
||||
################################ SNAPSHOTTING ################################
|
||||
#
|
||||
# Save the DB on disk:
|
||||
#
|
||||
# save <seconds> <changes>
|
||||
#
|
||||
# Will save the DB if both the given number of seconds and the given
|
||||
# number of write operations against the DB occurred.
|
||||
#
|
||||
# In the example below the behaviour will be to save:
|
||||
# after 900 sec (15 min) if at least 1 key changed
|
||||
# after 300 sec (5 min) if at least 10 keys changed
|
||||
# after 60 sec if at least 10000 keys changed
|
||||
#
|
||||
# Note: you can disable saving completely by commenting out all "save" lines.
|
||||
#
|
||||
# It is also possible to remove all the previously configured save
|
||||
# points by adding a save directive with a single empty string argument
|
||||
# like in the following example:
|
||||
#
|
||||
# save ""
|
||||
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
|
||||
# By default Redis will stop accepting writes if RDB snapshots are enabled
|
||||
# (at least one save point) and the latest background save failed.
|
||||
# This will make the user aware (in a hard way) that data is not persisting
|
||||
# on disk properly, otherwise chances are that no one will notice and some
|
||||
# disaster will happen.
|
||||
#
|
||||
# If the background saving process will start working again Redis will
|
||||
# automatically allow writes again.
|
||||
#
|
||||
# However if you have setup your proper monitoring of the Redis server
|
||||
# and persistence, you may want to disable this feature so that Redis will
|
||||
# continue to work as usual even if there are problems with disk,
|
||||
# permissions, and so forth.
|
||||
stop-writes-on-bgsave-error yes
|
||||
|
||||
# Compress string objects using LZF when dump .rdb databases?
|
||||
# For default that's set to 'yes' as it's almost always a win.
|
||||
# If you want to save some CPU in the saving child set it to 'no' but
|
||||
# the dataset will likely be bigger if you have compressible values or keys.
|
||||
rdbcompression yes
|
||||
|
||||
# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
|
||||
# This makes the format more resistant to corruption but there is a performance
|
||||
# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
|
||||
# for maximum performances.
|
||||
#
|
||||
# RDB files created with checksum disabled have a checksum of zero that will
|
||||
# tell the loading code to skip the check.
|
||||
rdbchecksum yes
|
||||
|
||||
# The filename where to dump the DB
|
||||
dbfilename dump.rdb
|
||||
|
||||
# The working directory.
|
||||
#
|
||||
# The DB will be written inside this directory, with the filename specified
|
||||
# above using the 'dbfilename' configuration directive.
|
||||
#
|
||||
# The Append Only File will also be created inside this directory.
|
||||
#
|
||||
# Note that you must specify a directory here, not a file name.
|
||||
dir ./
|
||||
|
||||
################################# REPLICATION #################################
|
||||
|
||||
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
|
||||
# another Redis server. A few things to understand ASAP about Redis replication.
|
||||
#
|
||||
# 1) Redis replication is asynchronous, but you can configure a master to
|
||||
# stop accepting writes if it appears to be not connected with at least
|
||||
# a given number of slaves.
|
||||
# 2) Redis slaves are able to perform a partial resynchronization with the
|
||||
# master if the replication link is lost for a relatively small amount of
|
||||
# time. You may want to configure the replication backlog size (see the next
|
||||
# sections of this file) with a sensible value depending on your needs.
|
||||
# 3) Replication is automatic and does not need user intervention. After a
|
||||
# network partition slaves automatically try to reconnect to masters
|
||||
# and resynchronize with them.
|
||||
#
|
||||
# slaveof <masterip> <masterport>
|
||||
|
||||
# If the master is password protected (using the "requirepass" configuration
|
||||
# directive below) it is possible to tell the slave to authenticate before
|
||||
# starting the replication synchronization process, otherwise the master will
|
||||
# refuse the slave request.
|
||||
#
|
||||
# masterauth <master-password>
|
||||
|
||||
# When a slave loses its connection with the master, or when the replication
|
||||
# is still in progress, the slave can act in two different ways:
|
||||
#
|
||||
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
|
||||
# still reply to client requests, possibly with out of date data, or the
|
||||
# data set may just be empty if this is the first synchronization.
|
||||
#
|
||||
# 2) if slave-serve-stale-data is set to 'no' the slave will reply with
|
||||
# an error "SYNC with master in progress" to all the kind of commands
|
||||
# but to INFO and SLAVEOF.
|
||||
#
|
||||
slave-serve-stale-data yes
|
||||
|
||||
# You can configure a slave instance to accept writes or not. Writing against
|
||||
# a slave instance may be useful to store some ephemeral data (because data
|
||||
# written on a slave will be easily deleted after resync with the master) but
|
||||
# may also cause problems if clients are writing to it because of a
|
||||
# misconfiguration.
|
||||
#
|
||||
# Since Redis 2.6 by default slaves are read-only.
|
||||
#
|
||||
# Note: read only slaves are not designed to be exposed to untrusted clients
|
||||
# on the internet. It's just a protection layer against misuse of the instance.
|
||||
# Still a read only slave exports by default all the administrative commands
|
||||
# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
|
||||
# security of read only slaves using 'rename-command' to shadow all the
|
||||
# administrative / dangerous commands.
|
||||
slave-read-only yes
|
||||
|
||||
# Replication SYNC strategy: disk or socket.
|
||||
#
|
||||
# -------------------------------------------------------
|
||||
# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
|
||||
# -------------------------------------------------------
|
||||
#
|
||||
# New slaves and reconnecting slaves that are not able to continue the replication
|
||||
# process just receiving differences, need to do what is called a "full
|
||||
# synchronization". An RDB file is transmitted from the master to the slaves.
|
||||
# The transmission can happen in two different ways:
|
||||
#
|
||||
# 1) Disk-backed: The Redis master creates a new process that writes the RDB
|
||||
# file on disk. Later the file is transferred by the parent
|
||||
# process to the slaves incrementally.
|
||||
# 2) Diskless: The Redis master creates a new process that directly writes the
|
||||
# RDB file to slave sockets, without touching the disk at all.
|
||||
#
|
||||
# With disk-backed replication, while the RDB file is generated, more slaves
|
||||
# can be queued and served with the RDB file as soon as the current child producing
|
||||
# the RDB file finishes its work. With diskless replication instead once
|
||||
# the transfer starts, new slaves arriving will be queued and a new transfer
|
||||
# will start when the current one terminates.
|
||||
#
|
||||
# When diskless replication is used, the master waits a configurable amount of
|
||||
# time (in seconds) before starting the transfer in the hope that multiple slaves
|
||||
# will arrive and the transfer can be parallelized.
|
||||
#
|
||||
# With slow disks and fast (large bandwidth) networks, diskless replication
|
||||
# works better.
|
||||
repl-diskless-sync no
|
||||
|
||||
# When diskless replication is enabled, it is possible to configure the delay
|
||||
# the server waits in order to spawn the child that transfers the RDB via socket
|
||||
# to the slaves.
|
||||
#
|
||||
# This is important since once the transfer starts, it is not possible to serve
|
||||
# new slaves arriving, that will be queued for the next RDB transfer, so the server
|
||||
# waits a delay in order to let more slaves arrive.
|
||||
#
|
||||
# The delay is specified in seconds, and by default is 5 seconds. To disable
|
||||
# it entirely just set it to 0 seconds and the transfer will start ASAP.
|
||||
repl-diskless-sync-delay 5
|
||||
|
||||
# Slaves send PINGs to server in a predefined interval. It's possible to change
|
||||
# this interval with the repl_ping_slave_period option. The default value is 10
|
||||
# seconds.
|
||||
#
|
||||
# repl-ping-slave-period 10
|
||||
|
||||
# The following option sets the replication timeout for:
|
||||
#
|
||||
# 1) Bulk transfer I/O during SYNC, from the point of view of slave.
|
||||
# 2) Master timeout from the point of view of slaves (data, pings).
|
||||
# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
|
||||
#
|
||||
# It is important to make sure that this value is greater than the value
|
||||
# specified for repl-ping-slave-period otherwise a timeout will be detected
|
||||
# every time there is low traffic between the master and the slave.
|
||||
#
|
||||
# repl-timeout 60
|
||||
|
||||
# Disable TCP_NODELAY on the slave socket after SYNC?
|
||||
#
|
||||
# If you select "yes" Redis will use a smaller number of TCP packets and
|
||||
# less bandwidth to send data to slaves. But this can add a delay for
|
||||
# the data to appear on the slave side, up to 40 milliseconds with
|
||||
# Linux kernels using a default configuration.
|
||||
#
|
||||
# If you select "no" the delay for data to appear on the slave side will
|
||||
# be reduced but more bandwidth will be used for replication.
|
||||
#
|
||||
# By default we optimize for low latency, but in very high traffic conditions
|
||||
# or when the master and slaves are many hops away, turning this to "yes" may
|
||||
# be a good idea.
|
||||
repl-disable-tcp-nodelay no
|
||||
|
||||
# Set the replication backlog size. The backlog is a buffer that accumulates
|
||||
# slave data when slaves are disconnected for some time, so that when a slave
|
||||
# wants to reconnect again, often a full resync is not needed, but a partial
|
||||
# resync is enough, just passing the portion of data the slave missed while
|
||||
# disconnected.
|
||||
#
|
||||
# The bigger the replication backlog, the longer the time the slave can be
|
||||
# disconnected and later be able to perform a partial resynchronization.
|
||||
#
|
||||
# The backlog is only allocated once there is at least a slave connected.
|
||||
#
|
||||
# repl-backlog-size 1mb
|
||||
|
||||
# After a master has no longer connected slaves for some time, the backlog
|
||||
# will be freed. The following option configures the amount of seconds that
|
||||
# need to elapse, starting from the time the last slave disconnected, for
|
||||
# the backlog buffer to be freed.
|
||||
#
|
||||
# A value of 0 means to never release the backlog.
|
||||
#
|
||||
# repl-backlog-ttl 3600
|
||||
|
||||
# The slave priority is an integer number published by Redis in the INFO output.
|
||||
# It is used by Redis Sentinel in order to select a slave to promote into a
|
||||
# master if the master is no longer working correctly.
|
||||
#
|
||||
# A slave with a low priority number is considered better for promotion, so
|
||||
# for instance if there are three slaves with priority 10, 100, 25 Sentinel will
|
||||
# pick the one with priority 10, that is the lowest.
|
||||
#
|
||||
# However a special priority of 0 marks the slave as not able to perform the
|
||||
# role of master, so a slave with priority of 0 will never be selected by
|
||||
# Redis Sentinel for promotion.
|
||||
#
|
||||
# By default the priority is 100.
|
||||
slave-priority 100
|
||||
|
||||
# It is possible for a master to stop accepting writes if there are less than
|
||||
# N slaves connected, having a lag less or equal than M seconds.
|
||||
#
|
||||
# The N slaves need to be in "online" state.
|
||||
#
|
||||
# The lag in seconds, that must be <= the specified value, is calculated from
|
||||
# the last ping received from the slave, that is usually sent every second.
|
||||
#
|
||||
# This option does not GUARANTEE that N replicas will accept the write, but
|
||||
# will limit the window of exposure for lost writes in case not enough slaves
|
||||
# are available, to the specified number of seconds.
|
||||
#
|
||||
# For example to require at least 3 slaves with a lag <= 10 seconds use:
|
||||
#
|
||||
# min-slaves-to-write 3
|
||||
# min-slaves-max-lag 10
|
||||
#
|
||||
# Setting one or the other to 0 disables the feature.
|
||||
#
|
||||
# By default min-slaves-to-write is set to 0 (feature disabled) and
|
||||
# min-slaves-max-lag is set to 10.
|
||||
|
||||
################################## SECURITY ###################################
|
||||
|
||||
# Require clients to issue AUTH <PASSWORD> before processing any other
|
||||
# commands. This might be useful in environments in which you do not trust
|
||||
# others with access to the host running redis-server.
|
||||
#
|
||||
# This should stay commented out for backward compatibility and because most
|
||||
# people do not need auth (e.g. they run their own servers).
|
||||
#
|
||||
# Warning: since Redis is pretty fast an outside user can try up to
|
||||
# 150k passwords per second against a good box. This means that you should
|
||||
# use a very strong password otherwise it will be very easy to break.
|
||||
#
|
||||
# requirepass foobared
|
||||
|
||||
# Command renaming.
|
||||
#
|
||||
# It is possible to change the name of dangerous commands in a shared
|
||||
# environment. For instance the CONFIG command may be renamed into something
|
||||
# hard to guess so that it will still be available for internal-use tools
|
||||
# but not available for general clients.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
|
||||
#
|
||||
# It is also possible to completely kill a command by renaming it into
|
||||
# an empty string:
|
||||
#
|
||||
# rename-command CONFIG ""
|
||||
#
|
||||
# Please note that changing the name of commands that are logged into the
|
||||
# AOF file or transmitted to slaves may cause problems.
|
||||
|
||||
################################### LIMITS ####################################
|
||||
|
||||
# Set the max number of connected clients at the same time. By default
|
||||
# this limit is set to 10000 clients, however if the Redis server is not
|
||||
# able to configure the process file limit to allow for the specified limit
|
||||
# the max number of allowed clients is set to the current file limit
|
||||
# minus 32 (as Redis reserves a few file descriptors for internal uses).
|
||||
#
|
||||
# Once the limit is reached Redis will close all the new connections sending
|
||||
# an error 'max number of clients reached'.
|
||||
#
|
||||
# maxclients 10000
|
||||
|
||||
# If Redis is to be used as an in-memory-only cache without any kind of
|
||||
# persistence, then the fork() mechanism used by the background AOF/RDB
|
||||
# persistence is unnecessary. As an optimization, all persistence can be
|
||||
# turned off in the Windows version of Redis. This will redirect heap
|
||||
# allocations to the system heap allocator, and disable commands that would
|
||||
# otherwise cause fork() operations: BGSAVE and BGREWRITEAOF.
|
||||
# This flag may not be combined with any of the other flags that configure
|
||||
# AOF and RDB operations.
|
||||
# persistence-available [(yes)|no]
|
||||
|
||||
# Don't use more memory than the specified amount of bytes.
|
||||
# When the memory limit is reached Redis will try to remove keys
|
||||
# according to the eviction policy selected (see maxmemory-policy).
|
||||
#
|
||||
# If Redis can't remove keys according to the policy, or if the policy is
|
||||
# set to 'noeviction', Redis will start to reply with errors to commands
|
||||
# that would use more memory, like SET, LPUSH, and so on, and will continue
|
||||
# to reply to read-only commands like GET.
|
||||
#
|
||||
# This option is usually useful when using Redis as an LRU cache, or to set
|
||||
# a hard memory limit for an instance (using the 'noeviction' policy).
|
||||
#
|
||||
# WARNING: If you have slaves attached to an instance with maxmemory on,
|
||||
# the size of the output buffers needed to feed the slaves are subtracted
|
||||
# from the used memory count, so that network problems / resyncs will
|
||||
# not trigger a loop where keys are evicted, and in turn the output
|
||||
# buffer of slaves is full with DELs of keys evicted triggering the deletion
|
||||
# of more keys, and so forth until the database is completely emptied.
|
||||
#
|
||||
# In short... if you have slaves attached it is suggested that you set a lower
|
||||
# limit for maxmemory so that there is some free RAM on the system for slave
|
||||
# output buffers (but this is not needed if the policy is 'noeviction').
|
||||
#
|
||||
# WARNING: not setting maxmemory will cause Redis to terminate with an
|
||||
# out-of-memory exception if the heap limit is reached.
|
||||
#
|
||||
# NOTE: since Redis uses the system paging file to allocate the heap memory,
|
||||
# the Working Set memory usage showed by the Windows Task Manager or by other
|
||||
# tools such as ProcessExplorer will not always be accurate. For example, right
|
||||
# after a background save of the RDB or the AOF files, the working set value
|
||||
# may drop significantly. In order to check the correct amount of memory used
|
||||
# by the redis-server to store the data, use the INFO client command. The INFO
|
||||
# command shows only the memory used to store the redis data, not the extra
|
||||
# memory used by the Windows process for its own requirements. Th3 extra amount
|
||||
# of memory not reported by the INFO command can be calculated subtracting the
|
||||
# Peak Working Set reported by the Windows Task Manager and the used_memory_peak
|
||||
# reported by the INFO command.
|
||||
#
|
||||
# maxmemory <bytes>
|
||||
|
||||
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
|
||||
# is reached. You can select among five behaviors:
|
||||
#
|
||||
# volatile-lru -> remove the key with an expire set using an LRU algorithm
|
||||
# allkeys-lru -> remove any key according to the LRU algorithm
|
||||
# volatile-random -> remove a random key with an expire set
|
||||
# allkeys-random -> remove a random key, any key
|
||||
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
|
||||
# noeviction -> don't expire at all, just return an error on write operations
|
||||
#
|
||||
# Note: with any of the above policies, Redis will return an error on write
|
||||
# operations, when there are no suitable keys for eviction.
|
||||
#
|
||||
# At the date of writing these commands are: set setnx setex append
|
||||
# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
|
||||
# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
|
||||
# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
|
||||
# getset mset msetnx exec sort
|
||||
#
|
||||
# The default is:
|
||||
#
|
||||
# maxmemory-policy noeviction
|
||||
|
||||
# LRU and minimal TTL algorithms are not precise algorithms but approximated
|
||||
# algorithms (in order to save memory), so you can select as well the sample
|
||||
# size to check. For instance for default Redis will check three keys and
|
||||
# pick the one that was used less recently, you can change the sample size
|
||||
# using the following configuration directive.
|
||||
#
|
||||
# maxmemory-samples 3
|
||||
|
||||
############################## APPEND ONLY MODE ###############################
|
||||
|
||||
# By default Redis asynchronously dumps the dataset on disk. This mode is
|
||||
# good enough in many applications, but an issue with the Redis process or
|
||||
# a power outage may result into a few minutes of writes lost (depending on
|
||||
# the configured save points).
|
||||
#
|
||||
# The Append Only File is an alternative persistence mode that provides
|
||||
# much better durability. For instance using the default data fsync policy
|
||||
# (see later in the config file) Redis can lose just one second of writes in a
|
||||
# dramatic event like a server power outage, or a single write if something
|
||||
# wrong with the Redis process itself happens, but the operating system is
|
||||
# still running correctly.
|
||||
#
|
||||
# AOF and RDB persistence can be enabled at the same time without problems.
|
||||
# If the AOF is enabled on startup Redis will load the AOF, that is the file
|
||||
# with the better durability guarantees.
|
||||
#
|
||||
# Please check http://redis.io/topics/persistence for more information.
|
||||
|
||||
appendonly no
|
||||
|
||||
# The name of the append only file (default: "appendonly.aof")
|
||||
appendfilename "appendonly.aof"
|
||||
|
||||
# The fsync() call tells the Operating System to actually write data on disk
|
||||
# instead of waiting for more data in the output buffer. Some OS will really flush
|
||||
# data on disk, some other OS will just try to do it ASAP.
|
||||
#
|
||||
# Redis supports three different modes:
|
||||
#
|
||||
# no: don't fsync, just let the OS flush the data when it wants. Faster.
|
||||
# always: fsync after every write to the append only log . Slow, Safest.
|
||||
# everysec: fsync only one time every second. Compromise.
|
||||
#
|
||||
# The default is "everysec", as that's usually the right compromise between
|
||||
# speed and data safety. It's up to you to understand if you can relax this to
|
||||
# "no" that will let the operating system flush the output buffer when
|
||||
# it wants, for better performances (but if you can live with the idea of
|
||||
# some data loss consider the default persistence mode that's snapshotting),
|
||||
# or on the contrary, use "always" that's very slow but a bit safer than
|
||||
# everysec.
|
||||
#
|
||||
# More details please check the following article:
|
||||
# http://antirez.com/post/redis-persistence-demystified.html
|
||||
#
|
||||
# If unsure, use "everysec".
|
||||
|
||||
# appendfsync always
|
||||
appendfsync everysec
|
||||
# appendfsync no
|
||||
|
||||
# When the AOF fsync policy is set to always or everysec, and a background
|
||||
# saving process (a background save or AOF log background rewriting) is
|
||||
# performing a lot of I/O against the disk, in some Linux configurations
|
||||
# Redis may block too long on the fsync() call. Note that there is no fix for
|
||||
# this currently, as even performing fsync in a different thread will block
|
||||
# our synchronous write(2) call.
|
||||
#
|
||||
# In order to mitigate this problem it's possible to use the following option
|
||||
# that will prevent fsync() from being called in the main process while a
|
||||
# BGSAVE or BGREWRITEAOF is in progress.
|
||||
#
|
||||
# This means that while another child is saving, the durability of Redis is
|
||||
# the same as "appendfsync none". In practical terms, this means that it is
|
||||
# possible to lose up to 30 seconds of log in the worst scenario (with the
|
||||
# default Linux settings).
|
||||
#
|
||||
# If you have latency problems turn this to "yes". Otherwise leave it as
|
||||
# "no" that is the safest pick from the point of view of durability.
|
||||
no-appendfsync-on-rewrite no
|
||||
|
||||
# Automatic rewrite of the append only file.
|
||||
# Redis is able to automatically rewrite the log file implicitly calling
|
||||
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
|
||||
#
|
||||
# This is how it works: Redis remembers the size of the AOF file after the
|
||||
# latest rewrite (if no rewrite has happened since the restart, the size of
|
||||
# the AOF at startup is used).
|
||||
#
|
||||
# This base size is compared to the current size. If the current size is
|
||||
# bigger than the specified percentage, the rewrite is triggered. Also
|
||||
# you need to specify a minimal size for the AOF file to be rewritten, this
|
||||
# is useful to avoid rewriting the AOF file even if the percentage increase
|
||||
# is reached but it is still pretty small.
|
||||
#
|
||||
# Specify a percentage of zero in order to disable the automatic AOF
|
||||
# rewrite feature.
|
||||
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
|
||||
# An AOF file may be found to be truncated at the end during the Redis
|
||||
# startup process, when the AOF data gets loaded back into memory.
|
||||
# This may happen when the system where Redis is running
|
||||
# crashes, especially when an ext4 filesystem is mounted without the
|
||||
# data=ordered option (however this can't happen when Redis itself
|
||||
# crashes or aborts but the operating system still works correctly).
|
||||
#
|
||||
# Redis can either exit with an error when this happens, or load as much
|
||||
# data as possible (the default now) and start if the AOF file is found
|
||||
# to be truncated at the end. The following option controls this behavior.
|
||||
#
|
||||
# If aof-load-truncated is set to yes, a truncated AOF file is loaded and
|
||||
# the Redis server starts emitting a log to inform the user of the event.
|
||||
# Otherwise if the option is set to no, the server aborts with an error
|
||||
# and refuses to start. When the option is set to no, the user requires
|
||||
# to fix the AOF file using the "redis-check-aof" utility before to restart
|
||||
# the server.
|
||||
#
|
||||
# Note that if the AOF file will be found to be corrupted in the middle
|
||||
# the server will still exit with an error. This option only applies when
|
||||
# Redis will try to read more data from the AOF file but not enough bytes
|
||||
# will be found.
|
||||
aof-load-truncated yes
|
||||
|
||||
################################ LUA SCRIPTING ###############################
|
||||
|
||||
# Max execution time of a Lua script in milliseconds.
|
||||
#
|
||||
# If the maximum execution time is reached Redis will log that a script is
|
||||
# still in execution after the maximum allowed time and will start to
|
||||
# reply to queries with an error.
|
||||
#
|
||||
# When a long running script exceeds the maximum execution time only the
|
||||
# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
|
||||
# used to stop a script that did not yet called write commands. The second
|
||||
# is the only way to shut down the server in the case a write command was
|
||||
# already issued by the script but the user doesn't want to wait for the natural
|
||||
# termination of the script.
|
||||
#
|
||||
# Set it to 0 or a negative value for unlimited execution without warnings.
|
||||
lua-time-limit 5000
|
||||
|
||||
################################ REDIS CLUSTER ###############################
|
||||
#
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
|
||||
# in order to mark it as "mature" we need to wait for a non trivial percentage
|
||||
# of users to deploy it in production.
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#
|
||||
# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
|
||||
# started as cluster nodes can. In order to start a Redis instance as a
|
||||
# cluster node enable the cluster support uncommenting the following:
|
||||
#
|
||||
# cluster-enabled yes
|
||||
|
||||
# Every cluster node has a cluster configuration file. This file is not
|
||||
# intended to be edited by hand. It is created and updated by Redis nodes.
|
||||
# Every Redis Cluster node requires a different cluster configuration file.
|
||||
# Make sure that instances running in the same system do not have
|
||||
# overlapping cluster configuration file names.
|
||||
#
|
||||
# cluster-config-file nodes-6379.conf
|
||||
|
||||
# Cluster node timeout is the amount of milliseconds a node must be unreachable
|
||||
# for it to be considered in failure state.
|
||||
# Most other internal time limits are multiple of the node timeout.
|
||||
#
|
||||
# cluster-node-timeout 15000
|
||||
|
||||
# A slave of a failing master will avoid to start a failover if its data
|
||||
# looks too old.
|
||||
#
|
||||
# There is no simple way for a slave to actually have a exact measure of
|
||||
# its "data age", so the following two checks are performed:
|
||||
#
|
||||
# 1) If there are multiple slaves able to failover, they exchange messages
|
||||
# in order to try to give an advantage to the slave with the best
|
||||
# replication offset (more data from the master processed).
|
||||
# Slaves will try to get their rank by offset, and apply to the start
|
||||
# of the failover a delay proportional to their rank.
|
||||
#
|
||||
# 2) Every single slave computes the time of the last interaction with
|
||||
# its master. This can be the last ping or command received (if the master
|
||||
# is still in the "connected" state), or the time that elapsed since the
|
||||
# disconnection with the master (if the replication link is currently down).
|
||||
# If the last interaction is too old, the slave will not try to failover
|
||||
# at all.
|
||||
#
|
||||
# The point "2" can be tuned by user. Specifically a slave will not perform
|
||||
# the failover if, since the last interaction with the master, the time
|
||||
# elapsed is greater than:
|
||||
#
|
||||
# (node-timeout * slave-validity-factor) + repl-ping-slave-period
|
||||
#
|
||||
# So for example if node-timeout is 30 seconds, and the slave-validity-factor
|
||||
# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
|
||||
# slave will not try to failover if it was not able to talk with the master
|
||||
# for longer than 310 seconds.
|
||||
#
|
||||
# A large slave-validity-factor may allow slaves with too old data to failover
|
||||
# a master, while a too small value may prevent the cluster from being able to
|
||||
# elect a slave at all.
|
||||
#
|
||||
# For maximum availability, it is possible to set the slave-validity-factor
|
||||
# to a value of 0, which means, that slaves will always try to failover the
|
||||
# master regardless of the last time they interacted with the master.
|
||||
# (However they'll always try to apply a delay proportional to their
|
||||
# offset rank).
|
||||
#
|
||||
# Zero is the only value able to guarantee that when all the partitions heal
|
||||
# the cluster will always be able to continue.
|
||||
#
|
||||
# cluster-slave-validity-factor 10
|
||||
|
||||
# Cluster slaves are able to migrate to orphaned masters, that are masters
|
||||
# that are left without working slaves. This improves the cluster ability
|
||||
# to resist to failures as otherwise an orphaned master can't be failed over
|
||||
# in case of failure if it has no working slaves.
|
||||
#
|
||||
# Slaves migrate to orphaned masters only if there are still at least a
|
||||
# given number of other working slaves for their old master. This number
|
||||
# is the "migration barrier". A migration barrier of 1 means that a slave
|
||||
# will migrate only if there is at least 1 other working slave for its master
|
||||
# and so forth. It usually reflects the number of slaves you want for every
|
||||
# master in your cluster.
|
||||
#
|
||||
# Default is 1 (slaves migrate only if their masters remain with at least
|
||||
# one slave). To disable migration just set it to a very large value.
|
||||
# A value of 0 can be set but is useful only for debugging and dangerous
|
||||
# in production.
|
||||
#
|
||||
# cluster-migration-barrier 1
|
||||
|
||||
# By default Redis Cluster nodes stop accepting queries if they detect there
|
||||
# is at least an hash slot uncovered (no available node is serving it).
|
||||
# This way if the cluster is partially down (for example a range of hash slots
|
||||
# are no longer covered) all the cluster becomes, eventually, unavailable.
|
||||
# It automatically returns available as soon as all the slots are covered again.
|
||||
#
|
||||
# However sometimes you want the subset of the cluster which is working,
|
||||
# to continue to accept queries for the part of the key space that is still
|
||||
# covered. In order to do so, just set the cluster-require-full-coverage
|
||||
# option to no.
|
||||
#
|
||||
# cluster-require-full-coverage yes
|
||||
|
||||
# In order to setup your cluster make sure to read the documentation
|
||||
# available at http://redis.io web site.
|
||||
|
||||
################################## SLOW LOG ###################################
|
||||
|
||||
# The Redis Slow Log is a system to log queries that exceeded a specified
|
||||
# execution time. The execution time does not include the I/O operations
|
||||
# like talking with the client, sending the reply and so forth,
|
||||
# but just the time needed to actually execute the command (this is the only
|
||||
# stage of command execution where the thread is blocked and can not serve
|
||||
# other requests in the meantime).
|
||||
#
|
||||
# You can configure the slow log with two parameters: one tells Redis
|
||||
# what is the execution time, in microseconds, to exceed in order for the
|
||||
# command to get logged, and the other parameter is the length of the
|
||||
# slow log. When a new command is logged the oldest one is removed from the
|
||||
# queue of logged commands.
|
||||
|
||||
# The following time is expressed in microseconds, so 1000000 is equivalent
|
||||
# to one second. Note that a negative number disables the slow log, while
|
||||
# a value of zero forces the logging of every command.
|
||||
slowlog-log-slower-than 10000
|
||||
|
||||
# There is no limit to this length. Just be aware that it will consume memory.
|
||||
# You can reclaim memory used by the slow log with SLOWLOG RESET.
|
||||
slowlog-max-len 128
|
||||
|
||||
################################ LATENCY MONITOR ##############################
|
||||
|
||||
# The Redis latency monitoring subsystem samples different operations
|
||||
# at runtime in order to collect data related to possible sources of
|
||||
# latency of a Redis instance.
|
||||
#
|
||||
# Via the LATENCY command this information is available to the user that can
|
||||
# print graphs and obtain reports.
|
||||
#
|
||||
# The system only logs operations that were performed in a time equal or
|
||||
# greater than the amount of milliseconds specified via the
|
||||
# latency-monitor-threshold configuration directive. When its value is set
|
||||
# to zero, the latency monitor is turned off.
|
||||
#
|
||||
# By default latency monitoring is disabled since it is mostly not needed
|
||||
# if you don't have latency issues, and collecting data has a performance
|
||||
# impact, that while very small, can be measured under big load. Latency
|
||||
# monitoring can easily be enabled at runtime using the command
|
||||
# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
|
||||
latency-monitor-threshold 0
|
||||
|
||||
############################# Event notification ##############################
|
||||
|
||||
# Redis can notify Pub/Sub clients about events happening in the key space.
|
||||
# This feature is documented at http://redis.io/topics/notifications
|
||||
#
|
||||
# For instance if keyspace events notification is enabled, and a client
|
||||
# performs a DEL operation on key "foo" stored in the Database 0, two
|
||||
# messages will be published via Pub/Sub:
|
||||
#
|
||||
# PUBLISH __keyspace@0__:foo del
|
||||
# PUBLISH __keyevent@0__:del foo
|
||||
#
|
||||
# It is possible to select the events that Redis will notify among a set
|
||||
# of classes. Every class is identified by a single character:
|
||||
#
|
||||
# K Keyspace events, published with __keyspace@<db>__ prefix.
|
||||
# E Keyevent events, published with __keyevent@<db>__ prefix.
|
||||
# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
|
||||
# $ String commands
|
||||
# l List commands
|
||||
# s Set commands
|
||||
# h Hash commands
|
||||
# z Sorted set commands
|
||||
# x Expired events (events generated every time a key expires)
|
||||
# e Evicted events (events generated when a key is evicted for maxmemory)
|
||||
# A Alias for g$lshzxe, so that the "AKE" string means all the events.
|
||||
#
|
||||
# The "notify-keyspace-events" takes as argument a string that is composed
|
||||
# of zero or multiple characters. The empty string means that notifications
|
||||
# are disabled.
|
||||
#
|
||||
# Example: to enable list and generic events, from the point of view of the
|
||||
# event name, use:
|
||||
#
|
||||
# notify-keyspace-events Elg
|
||||
#
|
||||
# Example 2: to get the stream of the expired keys subscribing to channel
|
||||
# name __keyevent@0__:expired use:
|
||||
#
|
||||
# notify-keyspace-events Ex
|
||||
#
|
||||
# By default all notifications are disabled because most users don't need
|
||||
# this feature and the feature has some overhead. Note that if you don't
|
||||
# specify at least one of K or E, no events will be delivered.
|
||||
notify-keyspace-events ""
|
||||
|
||||
############################### ADVANCED CONFIG ###############################
|
||||
|
||||
# Hashes are encoded using a memory efficient data structure when they have a
|
||||
# small number of entries, and the biggest entry does not exceed a given
|
||||
# threshold. These thresholds can be configured using the following directives.
|
||||
hash-max-ziplist-entries 512
|
||||
hash-max-ziplist-value 64
|
||||
|
||||
# Similarly to hashes, small lists are also encoded in a special way in order
|
||||
# to save a lot of space. The special representation is only used when
|
||||
# you are under the following limits:
|
||||
list-max-ziplist-entries 512
|
||||
list-max-ziplist-value 64
|
||||
|
||||
# Sets have a special encoding in just one case: when a set is composed
|
||||
# of just strings that happen to be integers in radix 10 in the range
|
||||
# of 64 bit signed integers.
|
||||
# The following configuration setting sets the limit in the size of the
|
||||
# set in order to use this special memory saving encoding.
|
||||
set-max-intset-entries 512
|
||||
|
||||
# Similarly to hashes and lists, sorted sets are also specially encoded in
|
||||
# order to save a lot of space. This encoding is only used when the length and
|
||||
# elements of a sorted set are below the following limits:
|
||||
zset-max-ziplist-entries 128
|
||||
zset-max-ziplist-value 64
|
||||
|
||||
# HyperLogLog sparse representation bytes limit. The limit includes the
|
||||
# 16 bytes header. When an HyperLogLog using the sparse representation crosses
|
||||
# this limit, it is converted into the dense representation.
|
||||
#
|
||||
# A value greater than 16000 is totally useless, since at that point the
|
||||
# dense representation is more memory efficient.
|
||||
#
|
||||
# The suggested value is ~ 3000 in order to have the benefits of
|
||||
# the space efficient encoding without slowing down too much PFADD,
|
||||
# which is O(N) with the sparse encoding. The value can be raised to
|
||||
# ~ 10000 when CPU is not a concern, but space is, and the data set is
|
||||
# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
|
||||
hll-sparse-max-bytes 3000
|
||||
|
||||
# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
|
||||
# order to help rehashing the main Redis hash table (the one mapping top-level
|
||||
# keys to values). The hash table implementation Redis uses (see dict.c)
|
||||
# performs a lazy rehashing: the more operation you run into a hash table
|
||||
# that is rehashing, the more rehashing "steps" are performed, so if the
|
||||
# server is idle the rehashing is never complete and some more memory is used
|
||||
# by the hash table.
|
||||
#
|
||||
# The default is to use this millisecond 10 times every second in order to
|
||||
# actively rehash the main dictionaries, freeing memory when possible.
|
||||
#
|
||||
# If unsure:
|
||||
# use "activerehashing no" if you have hard latency requirements and it is
|
||||
# not a good thing in your environment that Redis can reply from time to time
|
||||
# to queries with 2 milliseconds delay.
|
||||
#
|
||||
# use "activerehashing yes" if you don't have such hard requirements but
|
||||
# want to free memory asap when possible.
|
||||
activerehashing yes
|
||||
|
||||
# The client output buffer limits can be used to force disconnection of clients
|
||||
# that are not reading data from the server fast enough for some reason (a
|
||||
# common reason is that a Pub/Sub client can't consume messages as fast as the
|
||||
# publisher can produce them).
|
||||
#
|
||||
# The limit can be set differently for the three different classes of clients:
|
||||
#
|
||||
# normal -> normal clients including MONITOR clients
|
||||
# slave -> slave clients
|
||||
# pubsub -> clients subscribed to at least one pubsub channel or pattern
|
||||
#
|
||||
# The syntax of every client-output-buffer-limit directive is the following:
|
||||
#
|
||||
# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
|
||||
#
|
||||
# A client is immediately disconnected once the hard limit is reached, or if
|
||||
# the soft limit is reached and remains reached for the specified number of
|
||||
# seconds (continuously).
|
||||
# So for instance if the hard limit is 32 megabytes and the soft limit is
|
||||
# 16 megabytes / 10 seconds, the client will get disconnected immediately
|
||||
# if the size of the output buffers reach 32 megabytes, but will also get
|
||||
# disconnected if the client reaches 16 megabytes and continuously overcomes
|
||||
# the limit for 10 seconds.
|
||||
#
|
||||
# By default normal clients are not limited because they don't receive data
|
||||
# without asking (in a push way), but just after a request, so only
|
||||
# asynchronous clients may create a scenario where data is requested faster
|
||||
# than it can read.
|
||||
#
|
||||
# Instead there is a default limit for pubsub and slave clients, since
|
||||
# subscribers and slaves receive data in a push fashion.
|
||||
#
|
||||
# Both the hard or the soft limit can be disabled by setting them to zero.
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
|
||||
# Redis calls an internal function to perform many background tasks, like
|
||||
# closing connections of clients in timeot, purging expired keys that are
|
||||
# never requested, and so forth.
|
||||
#
|
||||
# Not all tasks are perforemd with the same frequency, but Redis checks for
|
||||
# tasks to perform according to the specified "hz" value.
|
||||
#
|
||||
# By default "hz" is set to 10. Raising the value will use more CPU when
|
||||
# Redis is idle, but at the same time will make Redis more responsive when
|
||||
# there are many keys expiring at the same time, and timeouts may be
|
||||
# handled with more precision.
|
||||
#
|
||||
# The range is between 1 and 500, however a value over 100 is usually not
|
||||
# a good idea. Most users should use the default of 10 and raise this up to
|
||||
# 100 only in environments where very low latency is required.
|
||||
hz 10
|
||||
|
||||
# When a child rewrites the AOF file, if the following option is enabled
|
||||
# the file will be fsync-ed every 32 MB of data generated. This is useful
|
||||
# in order to commit the file to the disk more incrementally and avoid
|
||||
# big latency spikes.
|
||||
aof-rewrite-incremental-fsync yes
|
||||
|
||||
################################## INCLUDES ###################################
|
||||
|
||||
# Include one or more other config files here. This is useful if you
|
||||
# have a standard template that goes to all Redis server but also need
|
||||
# to customize a few per-server settings. Include files can include
|
||||
# other files, so use this wisely.
|
||||
#
|
||||
# include /path/to/local.conf
|
||||
# include /path/to/other.conf
|
||||
@@ -0,0 +1,963 @@
|
||||
# Redis configuration file example
|
||||
|
||||
# Note on units: when memory size is needed, it is possible to specify
|
||||
# it in the usual form of 1k 5GB 4M and so forth:
|
||||
#
|
||||
# 1k => 1000 bytes
|
||||
# 1kb => 1024 bytes
|
||||
# 1m => 1000000 bytes
|
||||
# 1mb => 1024*1024 bytes
|
||||
# 1g => 1000000000 bytes
|
||||
# 1gb => 1024*1024*1024 bytes
|
||||
#
|
||||
# units are case insensitive so 1GB 1Gb 1gB are all the same.
|
||||
|
||||
################################## INCLUDES ###################################
|
||||
|
||||
# Include one or more other config files here. This is useful if you
|
||||
# have a standard template that goes to all Redis servers but also need
|
||||
# to customize a few per-server settings. Include files can include
|
||||
# other files, so use this wisely.
|
||||
#
|
||||
# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
|
||||
# from admin or Redis Sentinel. Since Redis always uses the last processed
|
||||
# line as value of a configuration directive, you'd better put includes
|
||||
# at the beginning of this file to avoid overwriting config change at runtime.
|
||||
#
|
||||
# If instead you are interested in using includes to override configuration
|
||||
# options, it is better to use include as the last line.
|
||||
#
|
||||
# include .\path\to\local.conf
|
||||
# include c:\path\to\other.conf
|
||||
|
||||
################################ GENERAL #####################################
|
||||
|
||||
# On Windows, daemonize and pidfile are not supported.
|
||||
# However, you can run redis as a Windows service, and specify a logfile.
|
||||
# The logfile will contain the pid.
|
||||
|
||||
# Accept connections on the specified port, default is 6379.
|
||||
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||
port 6379
|
||||
|
||||
# TCP listen() backlog.
|
||||
#
|
||||
# In high requests-per-second environments you need an high backlog in order
|
||||
# to avoid slow clients connections issues. Note that the Linux kernel
|
||||
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
|
||||
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
|
||||
# in order to get the desired effect.
|
||||
tcp-backlog 511
|
||||
|
||||
# By default Redis listens for connections from all the network interfaces
|
||||
# available on the server. It is possible to listen to just one or multiple
|
||||
# interfaces using the "bind" configuration directive, followed by one or
|
||||
# more IP addresses.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# bind 192.168.1.100 10.0.0.1
|
||||
# bind 127.0.0.1
|
||||
|
||||
|
||||
# Specify the path for the Unix socket that will be used to listen for
|
||||
# incoming connections. There is no default, so Redis will not listen
|
||||
# on a unix socket when not specified.
|
||||
#
|
||||
# unixsocket /tmp/redis.sock
|
||||
# unixsocketperm 700
|
||||
|
||||
# Close the connection after a client is idle for N seconds (0 to disable)
|
||||
timeout 0
|
||||
|
||||
# TCP keepalive.
|
||||
#
|
||||
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
|
||||
# of communication. This is useful for two reasons:
|
||||
#
|
||||
# 1) Detect dead peers.
|
||||
# 2) Take the connection alive from the point of view of network
|
||||
# equipment in the middle.
|
||||
#
|
||||
# On Linux, the specified value (in seconds) is the period used to send ACKs.
|
||||
# Note that to close the connection the double of the time is needed.
|
||||
# On other kernels the period depends on the kernel configuration.
|
||||
#
|
||||
# A reasonable value for this option is 60 seconds.
|
||||
tcp-keepalive 0
|
||||
|
||||
# Specify the server verbosity level.
|
||||
# This can be one of:
|
||||
# debug (a lot of information, useful for development/testing)
|
||||
# verbose (many rarely useful info, but not a mess like the debug level)
|
||||
# notice (moderately verbose, what you want in production probably)
|
||||
# warning (only very important / critical messages are logged)
|
||||
loglevel notice
|
||||
|
||||
# Specify the log file name. Also 'stdout' can be used to force
|
||||
# Redis to log on the standard output.
|
||||
logfile ""
|
||||
|
||||
# To enable logging to the Windows EventLog, just set 'syslog-enabled' to
|
||||
# yes, and optionally update the other syslog parameters to suit your needs.
|
||||
# If Redis is installed and launched as a Windows Service, this will
|
||||
# automatically be enabled.
|
||||
# syslog-enabled no
|
||||
|
||||
# Specify the source name of the events in the Windows Application log.
|
||||
# syslog-ident redis
|
||||
|
||||
# Set the number of databases. The default database is DB 0, you can select
|
||||
# a different one on a per-connection basis using SELECT <dbid> where
|
||||
# dbid is a number between 0 and 'databases'-1
|
||||
databases 16
|
||||
|
||||
################################ SNAPSHOTTING ################################
|
||||
#
|
||||
# Save the DB on disk:
|
||||
#
|
||||
# save <seconds> <changes>
|
||||
#
|
||||
# Will save the DB if both the given number of seconds and the given
|
||||
# number of write operations against the DB occurred.
|
||||
#
|
||||
# In the example below the behaviour will be to save:
|
||||
# after 900 sec (15 min) if at least 1 key changed
|
||||
# after 300 sec (5 min) if at least 10 keys changed
|
||||
# after 60 sec if at least 10000 keys changed
|
||||
#
|
||||
# Note: you can disable saving completely by commenting out all "save" lines.
|
||||
#
|
||||
# It is also possible to remove all the previously configured save
|
||||
# points by adding a save directive with a single empty string argument
|
||||
# like in the following example:
|
||||
#
|
||||
# save ""
|
||||
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
|
||||
# By default Redis will stop accepting writes if RDB snapshots are enabled
|
||||
# (at least one save point) and the latest background save failed.
|
||||
# This will make the user aware (in a hard way) that data is not persisting
|
||||
# on disk properly, otherwise chances are that no one will notice and some
|
||||
# disaster will happen.
|
||||
#
|
||||
# If the background saving process will start working again Redis will
|
||||
# automatically allow writes again.
|
||||
#
|
||||
# However if you have setup your proper monitoring of the Redis server
|
||||
# and persistence, you may want to disable this feature so that Redis will
|
||||
# continue to work as usual even if there are problems with disk,
|
||||
# permissions, and so forth.
|
||||
stop-writes-on-bgsave-error yes
|
||||
|
||||
# Compress string objects using LZF when dump .rdb databases?
|
||||
# For default that's set to 'yes' as it's almost always a win.
|
||||
# If you want to save some CPU in the saving child set it to 'no' but
|
||||
# the dataset will likely be bigger if you have compressible values or keys.
|
||||
rdbcompression yes
|
||||
|
||||
# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
|
||||
# This makes the format more resistant to corruption but there is a performance
|
||||
# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
|
||||
# for maximum performances.
|
||||
#
|
||||
# RDB files created with checksum disabled have a checksum of zero that will
|
||||
# tell the loading code to skip the check.
|
||||
rdbchecksum yes
|
||||
|
||||
# The filename where to dump the DB
|
||||
dbfilename dump.rdb
|
||||
|
||||
# The working directory.
|
||||
#
|
||||
# The DB will be written inside this directory, with the filename specified
|
||||
# above using the 'dbfilename' configuration directive.
|
||||
#
|
||||
# The Append Only File will also be created inside this directory.
|
||||
#
|
||||
# Note that you must specify a directory here, not a file name.
|
||||
dir ./
|
||||
|
||||
################################# REPLICATION #################################
|
||||
|
||||
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
|
||||
# another Redis server. A few things to understand ASAP about Redis replication.
|
||||
#
|
||||
# 1) Redis replication is asynchronous, but you can configure a master to
|
||||
# stop accepting writes if it appears to be not connected with at least
|
||||
# a given number of slaves.
|
||||
# 2) Redis slaves are able to perform a partial resynchronization with the
|
||||
# master if the replication link is lost for a relatively small amount of
|
||||
# time. You may want to configure the replication backlog size (see the next
|
||||
# sections of this file) with a sensible value depending on your needs.
|
||||
# 3) Replication is automatic and does not need user intervention. After a
|
||||
# network partition slaves automatically try to reconnect to masters
|
||||
# and resynchronize with them.
|
||||
#
|
||||
# slaveof <masterip> <masterport>
|
||||
|
||||
# If the master is password protected (using the "requirepass" configuration
|
||||
# directive below) it is possible to tell the slave to authenticate before
|
||||
# starting the replication synchronization process, otherwise the master will
|
||||
# refuse the slave request.
|
||||
#
|
||||
# masterauth <master-password>
|
||||
|
||||
# When a slave loses its connection with the master, or when the replication
|
||||
# is still in progress, the slave can act in two different ways:
|
||||
#
|
||||
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
|
||||
# still reply to client requests, possibly with out of date data, or the
|
||||
# data set may just be empty if this is the first synchronization.
|
||||
#
|
||||
# 2) if slave-serve-stale-data is set to 'no' the slave will reply with
|
||||
# an error "SYNC with master in progress" to all the kind of commands
|
||||
# but to INFO and SLAVEOF.
|
||||
#
|
||||
slave-serve-stale-data yes
|
||||
|
||||
# You can configure a slave instance to accept writes or not. Writing against
|
||||
# a slave instance may be useful to store some ephemeral data (because data
|
||||
# written on a slave will be easily deleted after resync with the master) but
|
||||
# may also cause problems if clients are writing to it because of a
|
||||
# misconfiguration.
|
||||
#
|
||||
# Since Redis 2.6 by default slaves are read-only.
|
||||
#
|
||||
# Note: read only slaves are not designed to be exposed to untrusted clients
|
||||
# on the internet. It's just a protection layer against misuse of the instance.
|
||||
# Still a read only slave exports by default all the administrative commands
|
||||
# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
|
||||
# security of read only slaves using 'rename-command' to shadow all the
|
||||
# administrative / dangerous commands.
|
||||
slave-read-only yes
|
||||
|
||||
# Replication SYNC strategy: disk or socket.
|
||||
#
|
||||
# -------------------------------------------------------
|
||||
# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
|
||||
# -------------------------------------------------------
|
||||
#
|
||||
# New slaves and reconnecting slaves that are not able to continue the replication
|
||||
# process just receiving differences, need to do what is called a "full
|
||||
# synchronization". An RDB file is transmitted from the master to the slaves.
|
||||
# The transmission can happen in two different ways:
|
||||
#
|
||||
# 1) Disk-backed: The Redis master creates a new process that writes the RDB
|
||||
# file on disk. Later the file is transferred by the parent
|
||||
# process to the slaves incrementally.
|
||||
# 2) Diskless: The Redis master creates a new process that directly writes the
|
||||
# RDB file to slave sockets, without touching the disk at all.
|
||||
#
|
||||
# With disk-backed replication, while the RDB file is generated, more slaves
|
||||
# can be queued and served with the RDB file as soon as the current child producing
|
||||
# the RDB file finishes its work. With diskless replication instead once
|
||||
# the transfer starts, new slaves arriving will be queued and a new transfer
|
||||
# will start when the current one terminates.
|
||||
#
|
||||
# When diskless replication is used, the master waits a configurable amount of
|
||||
# time (in seconds) before starting the transfer in the hope that multiple slaves
|
||||
# will arrive and the transfer can be parallelized.
|
||||
#
|
||||
# With slow disks and fast (large bandwidth) networks, diskless replication
|
||||
# works better.
|
||||
repl-diskless-sync no
|
||||
|
||||
# When diskless replication is enabled, it is possible to configure the delay
|
||||
# the server waits in order to spawn the child that transfers the RDB via socket
|
||||
# to the slaves.
|
||||
#
|
||||
# This is important since once the transfer starts, it is not possible to serve
|
||||
# new slaves arriving, that will be queued for the next RDB transfer, so the server
|
||||
# waits a delay in order to let more slaves arrive.
|
||||
#
|
||||
# The delay is specified in seconds, and by default is 5 seconds. To disable
|
||||
# it entirely just set it to 0 seconds and the transfer will start ASAP.
|
||||
repl-diskless-sync-delay 5
|
||||
|
||||
# Slaves send PINGs to server in a predefined interval. It's possible to change
|
||||
# this interval with the repl_ping_slave_period option. The default value is 10
|
||||
# seconds.
|
||||
#
|
||||
# repl-ping-slave-period 10
|
||||
|
||||
# The following option sets the replication timeout for:
|
||||
#
|
||||
# 1) Bulk transfer I/O during SYNC, from the point of view of slave.
|
||||
# 2) Master timeout from the point of view of slaves (data, pings).
|
||||
# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
|
||||
#
|
||||
# It is important to make sure that this value is greater than the value
|
||||
# specified for repl-ping-slave-period otherwise a timeout will be detected
|
||||
# every time there is low traffic between the master and the slave.
|
||||
#
|
||||
# repl-timeout 60
|
||||
|
||||
# Disable TCP_NODELAY on the slave socket after SYNC?
|
||||
#
|
||||
# If you select "yes" Redis will use a smaller number of TCP packets and
|
||||
# less bandwidth to send data to slaves. But this can add a delay for
|
||||
# the data to appear on the slave side, up to 40 milliseconds with
|
||||
# Linux kernels using a default configuration.
|
||||
#
|
||||
# If you select "no" the delay for data to appear on the slave side will
|
||||
# be reduced but more bandwidth will be used for replication.
|
||||
#
|
||||
# By default we optimize for low latency, but in very high traffic conditions
|
||||
# or when the master and slaves are many hops away, turning this to "yes" may
|
||||
# be a good idea.
|
||||
repl-disable-tcp-nodelay no
|
||||
|
||||
# Set the replication backlog size. The backlog is a buffer that accumulates
|
||||
# slave data when slaves are disconnected for some time, so that when a slave
|
||||
# wants to reconnect again, often a full resync is not needed, but a partial
|
||||
# resync is enough, just passing the portion of data the slave missed while
|
||||
# disconnected.
|
||||
#
|
||||
# The bigger the replication backlog, the longer the time the slave can be
|
||||
# disconnected and later be able to perform a partial resynchronization.
|
||||
#
|
||||
# The backlog is only allocated once there is at least a slave connected.
|
||||
#
|
||||
# repl-backlog-size 1mb
|
||||
|
||||
# After a master has no longer connected slaves for some time, the backlog
|
||||
# will be freed. The following option configures the amount of seconds that
|
||||
# need to elapse, starting from the time the last slave disconnected, for
|
||||
# the backlog buffer to be freed.
|
||||
#
|
||||
# A value of 0 means to never release the backlog.
|
||||
#
|
||||
# repl-backlog-ttl 3600
|
||||
|
||||
# The slave priority is an integer number published by Redis in the INFO output.
|
||||
# It is used by Redis Sentinel in order to select a slave to promote into a
|
||||
# master if the master is no longer working correctly.
|
||||
#
|
||||
# A slave with a low priority number is considered better for promotion, so
|
||||
# for instance if there are three slaves with priority 10, 100, 25 Sentinel will
|
||||
# pick the one with priority 10, that is the lowest.
|
||||
#
|
||||
# However a special priority of 0 marks the slave as not able to perform the
|
||||
# role of master, so a slave with priority of 0 will never be selected by
|
||||
# Redis Sentinel for promotion.
|
||||
#
|
||||
# By default the priority is 100.
|
||||
slave-priority 100
|
||||
|
||||
# It is possible for a master to stop accepting writes if there are less than
|
||||
# N slaves connected, having a lag less or equal than M seconds.
|
||||
#
|
||||
# The N slaves need to be in "online" state.
|
||||
#
|
||||
# The lag in seconds, that must be <= the specified value, is calculated from
|
||||
# the last ping received from the slave, that is usually sent every second.
|
||||
#
|
||||
# This option does not GUARANTEE that N replicas will accept the write, but
|
||||
# will limit the window of exposure for lost writes in case not enough slaves
|
||||
# are available, to the specified number of seconds.
|
||||
#
|
||||
# For example to require at least 3 slaves with a lag <= 10 seconds use:
|
||||
#
|
||||
# min-slaves-to-write 3
|
||||
# min-slaves-max-lag 10
|
||||
#
|
||||
# Setting one or the other to 0 disables the feature.
|
||||
#
|
||||
# By default min-slaves-to-write is set to 0 (feature disabled) and
|
||||
# min-slaves-max-lag is set to 10.
|
||||
|
||||
################################## SECURITY ###################################
|
||||
|
||||
# Require clients to issue AUTH <PASSWORD> before processing any other
|
||||
# commands. This might be useful in environments in which you do not trust
|
||||
# others with access to the host running redis-server.
|
||||
#
|
||||
# This should stay commented out for backward compatibility and because most
|
||||
# people do not need auth (e.g. they run their own servers).
|
||||
#
|
||||
# Warning: since Redis is pretty fast an outside user can try up to
|
||||
# 150k passwords per second against a good box. This means that you should
|
||||
# use a very strong password otherwise it will be very easy to break.
|
||||
#
|
||||
# requirepass foobared
|
||||
|
||||
# Command renaming.
|
||||
#
|
||||
# It is possible to change the name of dangerous commands in a shared
|
||||
# environment. For instance the CONFIG command may be renamed into something
|
||||
# hard to guess so that it will still be available for internal-use tools
|
||||
# but not available for general clients.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
|
||||
#
|
||||
# It is also possible to completely kill a command by renaming it into
|
||||
# an empty string:
|
||||
#
|
||||
# rename-command CONFIG ""
|
||||
#
|
||||
# Please note that changing the name of commands that are logged into the
|
||||
# AOF file or transmitted to slaves may cause problems.
|
||||
|
||||
################################### LIMITS ####################################
|
||||
|
||||
# Set the max number of connected clients at the same time. By default
|
||||
# this limit is set to 10000 clients, however if the Redis server is not
|
||||
# able to configure the process file limit to allow for the specified limit
|
||||
# the max number of allowed clients is set to the current file limit
|
||||
# minus 32 (as Redis reserves a few file descriptors for internal uses).
|
||||
#
|
||||
# Once the limit is reached Redis will close all the new connections sending
|
||||
# an error 'max number of clients reached'.
|
||||
#
|
||||
# maxclients 10000
|
||||
|
||||
# If Redis is to be used as an in-memory-only cache without any kind of
|
||||
# persistence, then the fork() mechanism used by the background AOF/RDB
|
||||
# persistence is unnecessary. As an optimization, all persistence can be
|
||||
# turned off in the Windows version of Redis. This will redirect heap
|
||||
# allocations to the system heap allocator, and disable commands that would
|
||||
# otherwise cause fork() operations: BGSAVE and BGREWRITEAOF.
|
||||
# This flag may not be combined with any of the other flags that configure
|
||||
# AOF and RDB operations.
|
||||
# persistence-available [(yes)|no]
|
||||
|
||||
# Don't use more memory than the specified amount of bytes.
|
||||
# When the memory limit is reached Redis will try to remove keys
|
||||
# according to the eviction policy selected (see maxmemory-policy).
|
||||
#
|
||||
# If Redis can't remove keys according to the policy, or if the policy is
|
||||
# set to 'noeviction', Redis will start to reply with errors to commands
|
||||
# that would use more memory, like SET, LPUSH, and so on, and will continue
|
||||
# to reply to read-only commands like GET.
|
||||
#
|
||||
# This option is usually useful when using Redis as an LRU cache, or to set
|
||||
# a hard memory limit for an instance (using the 'noeviction' policy).
|
||||
#
|
||||
# WARNING: If you have slaves attached to an instance with maxmemory on,
|
||||
# the size of the output buffers needed to feed the slaves are subtracted
|
||||
# from the used memory count, so that network problems / resyncs will
|
||||
# not trigger a loop where keys are evicted, and in turn the output
|
||||
# buffer of slaves is full with DELs of keys evicted triggering the deletion
|
||||
# of more keys, and so forth until the database is completely emptied.
|
||||
#
|
||||
# In short... if you have slaves attached it is suggested that you set a lower
|
||||
# limit for maxmemory so that there is some free RAM on the system for slave
|
||||
# output buffers (but this is not needed if the policy is 'noeviction').
|
||||
#
|
||||
# WARNING: not setting maxmemory will cause Redis to terminate with an
|
||||
# out-of-memory exception if the heap limit is reached.
|
||||
#
|
||||
# NOTE: since Redis uses the system paging file to allocate the heap memory,
|
||||
# the Working Set memory usage showed by the Windows Task Manager or by other
|
||||
# tools such as ProcessExplorer will not always be accurate. For example, right
|
||||
# after a background save of the RDB or the AOF files, the working set value
|
||||
# may drop significantly. In order to check the correct amount of memory used
|
||||
# by the redis-server to store the data, use the INFO client command. The INFO
|
||||
# command shows only the memory used to store the redis data, not the extra
|
||||
# memory used by the Windows process for its own requirements. Th3 extra amount
|
||||
# of memory not reported by the INFO command can be calculated subtracting the
|
||||
# Peak Working Set reported by the Windows Task Manager and the used_memory_peak
|
||||
# reported by the INFO command.
|
||||
#
|
||||
# maxmemory <bytes>
|
||||
|
||||
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
|
||||
# is reached. You can select among five behaviors:
|
||||
#
|
||||
# volatile-lru -> remove the key with an expire set using an LRU algorithm
|
||||
# allkeys-lru -> remove any key according to the LRU algorithm
|
||||
# volatile-random -> remove a random key with an expire set
|
||||
# allkeys-random -> remove a random key, any key
|
||||
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
|
||||
# noeviction -> don't expire at all, just return an error on write operations
|
||||
#
|
||||
# Note: with any of the above policies, Redis will return an error on write
|
||||
# operations, when there are no suitable keys for eviction.
|
||||
#
|
||||
# At the date of writing these commands are: set setnx setex append
|
||||
# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
|
||||
# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
|
||||
# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
|
||||
# getset mset msetnx exec sort
|
||||
#
|
||||
# The default is:
|
||||
#
|
||||
# maxmemory-policy noeviction
|
||||
|
||||
# LRU and minimal TTL algorithms are not precise algorithms but approximated
|
||||
# algorithms (in order to save memory), so you can select as well the sample
|
||||
# size to check. For instance for default Redis will check three keys and
|
||||
# pick the one that was used less recently, you can change the sample size
|
||||
# using the following configuration directive.
|
||||
#
|
||||
# maxmemory-samples 3
|
||||
|
||||
############################## APPEND ONLY MODE ###############################
|
||||
|
||||
# By default Redis asynchronously dumps the dataset on disk. This mode is
|
||||
# good enough in many applications, but an issue with the Redis process or
|
||||
# a power outage may result into a few minutes of writes lost (depending on
|
||||
# the configured save points).
|
||||
#
|
||||
# The Append Only File is an alternative persistence mode that provides
|
||||
# much better durability. For instance using the default data fsync policy
|
||||
# (see later in the config file) Redis can lose just one second of writes in a
|
||||
# dramatic event like a server power outage, or a single write if something
|
||||
# wrong with the Redis process itself happens, but the operating system is
|
||||
# still running correctly.
|
||||
#
|
||||
# AOF and RDB persistence can be enabled at the same time without problems.
|
||||
# If the AOF is enabled on startup Redis will load the AOF, that is the file
|
||||
# with the better durability guarantees.
|
||||
#
|
||||
# Please check http://redis.io/topics/persistence for more information.
|
||||
|
||||
appendonly no
|
||||
|
||||
# The name of the append only file (default: "appendonly.aof")
|
||||
appendfilename "appendonly.aof"
|
||||
|
||||
# The fsync() call tells the Operating System to actually write data on disk
|
||||
# instead of waiting for more data in the output buffer. Some OS will really flush
|
||||
# data on disk, some other OS will just try to do it ASAP.
|
||||
#
|
||||
# Redis supports three different modes:
|
||||
#
|
||||
# no: don't fsync, just let the OS flush the data when it wants. Faster.
|
||||
# always: fsync after every write to the append only log . Slow, Safest.
|
||||
# everysec: fsync only one time every second. Compromise.
|
||||
#
|
||||
# The default is "everysec", as that's usually the right compromise between
|
||||
# speed and data safety. It's up to you to understand if you can relax this to
|
||||
# "no" that will let the operating system flush the output buffer when
|
||||
# it wants, for better performances (but if you can live with the idea of
|
||||
# some data loss consider the default persistence mode that's snapshotting),
|
||||
# or on the contrary, use "always" that's very slow but a bit safer than
|
||||
# everysec.
|
||||
#
|
||||
# More details please check the following article:
|
||||
# http://antirez.com/post/redis-persistence-demystified.html
|
||||
#
|
||||
# If unsure, use "everysec".
|
||||
|
||||
# appendfsync always
|
||||
appendfsync everysec
|
||||
# appendfsync no
|
||||
|
||||
# When the AOF fsync policy is set to always or everysec, and a background
|
||||
# saving process (a background save or AOF log background rewriting) is
|
||||
# performing a lot of I/O against the disk, in some Linux configurations
|
||||
# Redis may block too long on the fsync() call. Note that there is no fix for
|
||||
# this currently, as even performing fsync in a different thread will block
|
||||
# our synchronous write(2) call.
|
||||
#
|
||||
# In order to mitigate this problem it's possible to use the following option
|
||||
# that will prevent fsync() from being called in the main process while a
|
||||
# BGSAVE or BGREWRITEAOF is in progress.
|
||||
#
|
||||
# This means that while another child is saving, the durability of Redis is
|
||||
# the same as "appendfsync none". In practical terms, this means that it is
|
||||
# possible to lose up to 30 seconds of log in the worst scenario (with the
|
||||
# default Linux settings).
|
||||
#
|
||||
# If you have latency problems turn this to "yes". Otherwise leave it as
|
||||
# "no" that is the safest pick from the point of view of durability.
|
||||
no-appendfsync-on-rewrite no
|
||||
|
||||
# Automatic rewrite of the append only file.
|
||||
# Redis is able to automatically rewrite the log file implicitly calling
|
||||
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
|
||||
#
|
||||
# This is how it works: Redis remembers the size of the AOF file after the
|
||||
# latest rewrite (if no rewrite has happened since the restart, the size of
|
||||
# the AOF at startup is used).
|
||||
#
|
||||
# This base size is compared to the current size. If the current size is
|
||||
# bigger than the specified percentage, the rewrite is triggered. Also
|
||||
# you need to specify a minimal size for the AOF file to be rewritten, this
|
||||
# is useful to avoid rewriting the AOF file even if the percentage increase
|
||||
# is reached but it is still pretty small.
|
||||
#
|
||||
# Specify a percentage of zero in order to disable the automatic AOF
|
||||
# rewrite feature.
|
||||
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
|
||||
# An AOF file may be found to be truncated at the end during the Redis
|
||||
# startup process, when the AOF data gets loaded back into memory.
|
||||
# This may happen when the system where Redis is running
|
||||
# crashes, especially when an ext4 filesystem is mounted without the
|
||||
# data=ordered option (however this can't happen when Redis itself
|
||||
# crashes or aborts but the operating system still works correctly).
|
||||
#
|
||||
# Redis can either exit with an error when this happens, or load as much
|
||||
# data as possible (the default now) and start if the AOF file is found
|
||||
# to be truncated at the end. The following option controls this behavior.
|
||||
#
|
||||
# If aof-load-truncated is set to yes, a truncated AOF file is loaded and
|
||||
# the Redis server starts emitting a log to inform the user of the event.
|
||||
# Otherwise if the option is set to no, the server aborts with an error
|
||||
# and refuses to start. When the option is set to no, the user requires
|
||||
# to fix the AOF file using the "redis-check-aof" utility before to restart
|
||||
# the server.
|
||||
#
|
||||
# Note that if the AOF file will be found to be corrupted in the middle
|
||||
# the server will still exit with an error. This option only applies when
|
||||
# Redis will try to read more data from the AOF file but not enough bytes
|
||||
# will be found.
|
||||
aof-load-truncated yes
|
||||
|
||||
################################ LUA SCRIPTING ###############################
|
||||
|
||||
# Max execution time of a Lua script in milliseconds.
|
||||
#
|
||||
# If the maximum execution time is reached Redis will log that a script is
|
||||
# still in execution after the maximum allowed time and will start to
|
||||
# reply to queries with an error.
|
||||
#
|
||||
# When a long running script exceeds the maximum execution time only the
|
||||
# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
|
||||
# used to stop a script that did not yet called write commands. The second
|
||||
# is the only way to shut down the server in the case a write command was
|
||||
# already issued by the script but the user doesn't want to wait for the natural
|
||||
# termination of the script.
|
||||
#
|
||||
# Set it to 0 or a negative value for unlimited execution without warnings.
|
||||
lua-time-limit 5000
|
||||
|
||||
################################ REDIS CLUSTER ###############################
|
||||
#
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
|
||||
# in order to mark it as "mature" we need to wait for a non trivial percentage
|
||||
# of users to deploy it in production.
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#
|
||||
# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
|
||||
# started as cluster nodes can. In order to start a Redis instance as a
|
||||
# cluster node enable the cluster support uncommenting the following:
|
||||
#
|
||||
# cluster-enabled yes
|
||||
|
||||
# Every cluster node has a cluster configuration file. This file is not
|
||||
# intended to be edited by hand. It is created and updated by Redis nodes.
|
||||
# Every Redis Cluster node requires a different cluster configuration file.
|
||||
# Make sure that instances running in the same system do not have
|
||||
# overlapping cluster configuration file names.
|
||||
#
|
||||
# cluster-config-file nodes-6379.conf
|
||||
|
||||
# Cluster node timeout is the amount of milliseconds a node must be unreachable
|
||||
# for it to be considered in failure state.
|
||||
# Most other internal time limits are multiple of the node timeout.
|
||||
#
|
||||
# cluster-node-timeout 15000
|
||||
|
||||
# A slave of a failing master will avoid to start a failover if its data
|
||||
# looks too old.
|
||||
#
|
||||
# There is no simple way for a slave to actually have a exact measure of
|
||||
# its "data age", so the following two checks are performed:
|
||||
#
|
||||
# 1) If there are multiple slaves able to failover, they exchange messages
|
||||
# in order to try to give an advantage to the slave with the best
|
||||
# replication offset (more data from the master processed).
|
||||
# Slaves will try to get their rank by offset, and apply to the start
|
||||
# of the failover a delay proportional to their rank.
|
||||
#
|
||||
# 2) Every single slave computes the time of the last interaction with
|
||||
# its master. This can be the last ping or command received (if the master
|
||||
# is still in the "connected" state), or the time that elapsed since the
|
||||
# disconnection with the master (if the replication link is currently down).
|
||||
# If the last interaction is too old, the slave will not try to failover
|
||||
# at all.
|
||||
#
|
||||
# The point "2" can be tuned by user. Specifically a slave will not perform
|
||||
# the failover if, since the last interaction with the master, the time
|
||||
# elapsed is greater than:
|
||||
#
|
||||
# (node-timeout * slave-validity-factor) + repl-ping-slave-period
|
||||
#
|
||||
# So for example if node-timeout is 30 seconds, and the slave-validity-factor
|
||||
# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
|
||||
# slave will not try to failover if it was not able to talk with the master
|
||||
# for longer than 310 seconds.
|
||||
#
|
||||
# A large slave-validity-factor may allow slaves with too old data to failover
|
||||
# a master, while a too small value may prevent the cluster from being able to
|
||||
# elect a slave at all.
|
||||
#
|
||||
# For maximum availability, it is possible to set the slave-validity-factor
|
||||
# to a value of 0, which means, that slaves will always try to failover the
|
||||
# master regardless of the last time they interacted with the master.
|
||||
# (However they'll always try to apply a delay proportional to their
|
||||
# offset rank).
|
||||
#
|
||||
# Zero is the only value able to guarantee that when all the partitions heal
|
||||
# the cluster will always be able to continue.
|
||||
#
|
||||
# cluster-slave-validity-factor 10
|
||||
|
||||
# Cluster slaves are able to migrate to orphaned masters, that are masters
|
||||
# that are left without working slaves. This improves the cluster ability
|
||||
# to resist to failures as otherwise an orphaned master can't be failed over
|
||||
# in case of failure if it has no working slaves.
|
||||
#
|
||||
# Slaves migrate to orphaned masters only if there are still at least a
|
||||
# given number of other working slaves for their old master. This number
|
||||
# is the "migration barrier". A migration barrier of 1 means that a slave
|
||||
# will migrate only if there is at least 1 other working slave for its master
|
||||
# and so forth. It usually reflects the number of slaves you want for every
|
||||
# master in your cluster.
|
||||
#
|
||||
# Default is 1 (slaves migrate only if their masters remain with at least
|
||||
# one slave). To disable migration just set it to a very large value.
|
||||
# A value of 0 can be set but is useful only for debugging and dangerous
|
||||
# in production.
|
||||
#
|
||||
# cluster-migration-barrier 1
|
||||
|
||||
# By default Redis Cluster nodes stop accepting queries if they detect there
|
||||
# is at least an hash slot uncovered (no available node is serving it).
|
||||
# This way if the cluster is partially down (for example a range of hash slots
|
||||
# are no longer covered) all the cluster becomes, eventually, unavailable.
|
||||
# It automatically returns available as soon as all the slots are covered again.
|
||||
#
|
||||
# However sometimes you want the subset of the cluster which is working,
|
||||
# to continue to accept queries for the part of the key space that is still
|
||||
# covered. In order to do so, just set the cluster-require-full-coverage
|
||||
# option to no.
|
||||
#
|
||||
# cluster-require-full-coverage yes
|
||||
|
||||
# In order to setup your cluster make sure to read the documentation
|
||||
# available at http://redis.io web site.
|
||||
|
||||
################################## SLOW LOG ###################################
|
||||
|
||||
# The Redis Slow Log is a system to log queries that exceeded a specified
|
||||
# execution time. The execution time does not include the I/O operations
|
||||
# like talking with the client, sending the reply and so forth,
|
||||
# but just the time needed to actually execute the command (this is the only
|
||||
# stage of command execution where the thread is blocked and can not serve
|
||||
# other requests in the meantime).
|
||||
#
|
||||
# You can configure the slow log with two parameters: one tells Redis
|
||||
# what is the execution time, in microseconds, to exceed in order for the
|
||||
# command to get logged, and the other parameter is the length of the
|
||||
# slow log. When a new command is logged the oldest one is removed from the
|
||||
# queue of logged commands.
|
||||
|
||||
# The following time is expressed in microseconds, so 1000000 is equivalent
|
||||
# to one second. Note that a negative number disables the slow log, while
|
||||
# a value of zero forces the logging of every command.
|
||||
slowlog-log-slower-than 10000
|
||||
|
||||
# There is no limit to this length. Just be aware that it will consume memory.
|
||||
# You can reclaim memory used by the slow log with SLOWLOG RESET.
|
||||
slowlog-max-len 128
|
||||
|
||||
################################ LATENCY MONITOR ##############################
|
||||
|
||||
# The Redis latency monitoring subsystem samples different operations
|
||||
# at runtime in order to collect data related to possible sources of
|
||||
# latency of a Redis instance.
|
||||
#
|
||||
# Via the LATENCY command this information is available to the user that can
|
||||
# print graphs and obtain reports.
|
||||
#
|
||||
# The system only logs operations that were performed in a time equal or
|
||||
# greater than the amount of milliseconds specified via the
|
||||
# latency-monitor-threshold configuration directive. When its value is set
|
||||
# to zero, the latency monitor is turned off.
|
||||
#
|
||||
# By default latency monitoring is disabled since it is mostly not needed
|
||||
# if you don't have latency issues, and collecting data has a performance
|
||||
# impact, that while very small, can be measured under big load. Latency
|
||||
# monitoring can easily be enabled at runtime using the command
|
||||
# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
|
||||
latency-monitor-threshold 0
|
||||
|
||||
############################# Event notification ##############################
|
||||
|
||||
# Redis can notify Pub/Sub clients about events happening in the key space.
|
||||
# This feature is documented at http://redis.io/topics/notifications
|
||||
#
|
||||
# For instance if keyspace events notification is enabled, and a client
|
||||
# performs a DEL operation on key "foo" stored in the Database 0, two
|
||||
# messages will be published via Pub/Sub:
|
||||
#
|
||||
# PUBLISH __keyspace@0__:foo del
|
||||
# PUBLISH __keyevent@0__:del foo
|
||||
#
|
||||
# It is possible to select the events that Redis will notify among a set
|
||||
# of classes. Every class is identified by a single character:
|
||||
#
|
||||
# K Keyspace events, published with __keyspace@<db>__ prefix.
|
||||
# E Keyevent events, published with __keyevent@<db>__ prefix.
|
||||
# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
|
||||
# $ String commands
|
||||
# l List commands
|
||||
# s Set commands
|
||||
# h Hash commands
|
||||
# z Sorted set commands
|
||||
# x Expired events (events generated every time a key expires)
|
||||
# e Evicted events (events generated when a key is evicted for maxmemory)
|
||||
# A Alias for g$lshzxe, so that the "AKE" string means all the events.
|
||||
#
|
||||
# The "notify-keyspace-events" takes as argument a string that is composed
|
||||
# of zero or multiple characters. The empty string means that notifications
|
||||
# are disabled.
|
||||
#
|
||||
# Example: to enable list and generic events, from the point of view of the
|
||||
# event name, use:
|
||||
#
|
||||
# notify-keyspace-events Elg
|
||||
#
|
||||
# Example 2: to get the stream of the expired keys subscribing to channel
|
||||
# name __keyevent@0__:expired use:
|
||||
#
|
||||
# notify-keyspace-events Ex
|
||||
#
|
||||
# By default all notifications are disabled because most users don't need
|
||||
# this feature and the feature has some overhead. Note that if you don't
|
||||
# specify at least one of K or E, no events will be delivered.
|
||||
notify-keyspace-events ""
|
||||
|
||||
############################### ADVANCED CONFIG ###############################
|
||||
|
||||
# Hashes are encoded using a memory efficient data structure when they have a
|
||||
# small number of entries, and the biggest entry does not exceed a given
|
||||
# threshold. These thresholds can be configured using the following directives.
|
||||
hash-max-ziplist-entries 512
|
||||
hash-max-ziplist-value 64
|
||||
|
||||
# Similarly to hashes, small lists are also encoded in a special way in order
|
||||
# to save a lot of space. The special representation is only used when
|
||||
# you are under the following limits:
|
||||
list-max-ziplist-entries 512
|
||||
list-max-ziplist-value 64
|
||||
|
||||
# Sets have a special encoding in just one case: when a set is composed
|
||||
# of just strings that happen to be integers in radix 10 in the range
|
||||
# of 64 bit signed integers.
|
||||
# The following configuration setting sets the limit in the size of the
|
||||
# set in order to use this special memory saving encoding.
|
||||
set-max-intset-entries 512
|
||||
|
||||
# Similarly to hashes and lists, sorted sets are also specially encoded in
|
||||
# order to save a lot of space. This encoding is only used when the length and
|
||||
# elements of a sorted set are below the following limits:
|
||||
zset-max-ziplist-entries 128
|
||||
zset-max-ziplist-value 64
|
||||
|
||||
# HyperLogLog sparse representation bytes limit. The limit includes the
|
||||
# 16 bytes header. When an HyperLogLog using the sparse representation crosses
|
||||
# this limit, it is converted into the dense representation.
|
||||
#
|
||||
# A value greater than 16000 is totally useless, since at that point the
|
||||
# dense representation is more memory efficient.
|
||||
#
|
||||
# The suggested value is ~ 3000 in order to have the benefits of
|
||||
# the space efficient encoding without slowing down too much PFADD,
|
||||
# which is O(N) with the sparse encoding. The value can be raised to
|
||||
# ~ 10000 when CPU is not a concern, but space is, and the data set is
|
||||
# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
|
||||
hll-sparse-max-bytes 3000
|
||||
|
||||
# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
|
||||
# order to help rehashing the main Redis hash table (the one mapping top-level
|
||||
# keys to values). The hash table implementation Redis uses (see dict.c)
|
||||
# performs a lazy rehashing: the more operation you run into a hash table
|
||||
# that is rehashing, the more rehashing "steps" are performed, so if the
|
||||
# server is idle the rehashing is never complete and some more memory is used
|
||||
# by the hash table.
|
||||
#
|
||||
# The default is to use this millisecond 10 times every second in order to
|
||||
# actively rehash the main dictionaries, freeing memory when possible.
|
||||
#
|
||||
# If unsure:
|
||||
# use "activerehashing no" if you have hard latency requirements and it is
|
||||
# not a good thing in your environment that Redis can reply from time to time
|
||||
# to queries with 2 milliseconds delay.
|
||||
#
|
||||
# use "activerehashing yes" if you don't have such hard requirements but
|
||||
# want to free memory asap when possible.
|
||||
activerehashing yes
|
||||
|
||||
# The client output buffer limits can be used to force disconnection of clients
|
||||
# that are not reading data from the server fast enough for some reason (a
|
||||
# common reason is that a Pub/Sub client can't consume messages as fast as the
|
||||
# publisher can produce them).
|
||||
#
|
||||
# The limit can be set differently for the three different classes of clients:
|
||||
#
|
||||
# normal -> normal clients including MONITOR clients
|
||||
# slave -> slave clients
|
||||
# pubsub -> clients subscribed to at least one pubsub channel or pattern
|
||||
#
|
||||
# The syntax of every client-output-buffer-limit directive is the following:
|
||||
#
|
||||
# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
|
||||
#
|
||||
# A client is immediately disconnected once the hard limit is reached, or if
|
||||
# the soft limit is reached and remains reached for the specified number of
|
||||
# seconds (continuously).
|
||||
# So for instance if the hard limit is 32 megabytes and the soft limit is
|
||||
# 16 megabytes / 10 seconds, the client will get disconnected immediately
|
||||
# if the size of the output buffers reach 32 megabytes, but will also get
|
||||
# disconnected if the client reaches 16 megabytes and continuously overcomes
|
||||
# the limit for 10 seconds.
|
||||
#
|
||||
# By default normal clients are not limited because they don't receive data
|
||||
# without asking (in a push way), but just after a request, so only
|
||||
# asynchronous clients may create a scenario where data is requested faster
|
||||
# than it can read.
|
||||
#
|
||||
# Instead there is a default limit for pubsub and slave clients, since
|
||||
# subscribers and slaves receive data in a push fashion.
|
||||
#
|
||||
# Both the hard or the soft limit can be disabled by setting them to zero.
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
|
||||
# Redis calls an internal function to perform many background tasks, like
|
||||
# closing connections of clients in timeot, purging expired keys that are
|
||||
# never requested, and so forth.
|
||||
#
|
||||
# Not all tasks are perforemd with the same frequency, but Redis checks for
|
||||
# tasks to perform according to the specified "hz" value.
|
||||
#
|
||||
# By default "hz" is set to 10. Raising the value will use more CPU when
|
||||
# Redis is idle, but at the same time will make Redis more responsive when
|
||||
# there are many keys expiring at the same time, and timeouts may be
|
||||
# handled with more precision.
|
||||
#
|
||||
# The range is between 1 and 500, however a value over 100 is usually not
|
||||
# a good idea. Most users should use the default of 10 and raise this up to
|
||||
# 100 only in environments where very low latency is required.
|
||||
hz 10
|
||||
|
||||
# When a child rewrites the AOF file, if the following option is enabled
|
||||
# the file will be fsync-ed every 32 MB of data generated. This is useful
|
||||
# in order to commit the file to the disk more incrementally and avoid
|
||||
# big latency spikes.
|
||||
aof-rewrite-incremental-fsync yes
|
||||
|
||||
################################## INCLUDES ###################################
|
||||
|
||||
# Include one or more other config files here. This is useful if you
|
||||
# have a standard template that goes to all Redis server but also need
|
||||
# to customize a few per-server settings. Include files can include
|
||||
# other files, so use this wisely.
|
||||
#
|
||||
# include /path/to/local.conf
|
||||
# include /path/to/other.conf
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Generated
+118
@@ -0,0 +1,118 @@
|
||||
|
||||
namespace Lskj.ProductDynamic.Controls
|
||||
{
|
||||
partial class ImageButton
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.linePanel = new DevExpress.XtraEditors.PanelControl();
|
||||
this.line = new DevExpress.XtraEditors.LabelControl();
|
||||
this.imageLabel = new DevExpress.XtraEditors.LabelControl();
|
||||
this.simplebButton = new DevExpress.XtraEditors.LabelControl();
|
||||
((System.ComponentModel.ISupportInitialize)(this.linePanel)).BeginInit();
|
||||
this.linePanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// linePanel
|
||||
//
|
||||
this.linePanel.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.linePanel.Appearance.BackColor2 = System.Drawing.Color.Transparent;
|
||||
this.linePanel.Appearance.BorderColor = System.Drawing.Color.Transparent;
|
||||
this.linePanel.Appearance.Options.UseBackColor = true;
|
||||
this.linePanel.Appearance.Options.UseBorderColor = true;
|
||||
this.linePanel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.linePanel.Controls.Add(this.line);
|
||||
this.linePanel.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.linePanel.Location = new System.Drawing.Point(52, 0);
|
||||
this.linePanel.Name = "linePanel";
|
||||
this.linePanel.Padding = new System.Windows.Forms.Padding(0, 8, 0, 8);
|
||||
this.linePanel.Size = new System.Drawing.Size(2, 50);
|
||||
this.linePanel.TabIndex = 5;
|
||||
//
|
||||
// line
|
||||
//
|
||||
this.line.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.line.Appearance.BorderColor = System.Drawing.Color.White;
|
||||
this.line.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
|
||||
this.line.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.line.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.line.Location = new System.Drawing.Point(0, 8);
|
||||
this.line.Name = "line";
|
||||
this.line.Size = new System.Drawing.Size(2, 34);
|
||||
this.line.TabIndex = 3;
|
||||
//
|
||||
// imageLabel
|
||||
//
|
||||
this.imageLabel.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.imageLabel.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
|
||||
this.imageLabel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.imageLabel.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.imageLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.imageLabel.Name = "imageLabel";
|
||||
this.imageLabel.Size = new System.Drawing.Size(52, 50);
|
||||
this.imageLabel.TabIndex = 1;
|
||||
//
|
||||
// simplebButton
|
||||
//
|
||||
this.simplebButton.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.simplebButton.Appearance.Font = new System.Drawing.Font("微软雅黑", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.simplebButton.Appearance.ForeColor = System.Drawing.Color.White;
|
||||
this.simplebButton.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
|
||||
this.simplebButton.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
|
||||
this.simplebButton.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.simplebButton.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.simplebButton.Location = new System.Drawing.Point(54, 0);
|
||||
this.simplebButton.Name = "simplebButton";
|
||||
this.simplebButton.Size = new System.Drawing.Size(196, 50);
|
||||
this.simplebButton.TabIndex = 6;
|
||||
this.simplebButton.Text = "按钮";
|
||||
//
|
||||
// ImageButton
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(123)))), ((int)(((byte)(250)))));
|
||||
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Controls.Add(this.simplebButton);
|
||||
this.Controls.Add(this.linePanel);
|
||||
this.Controls.Add(this.imageLabel);
|
||||
this.Name = "ImageButton";
|
||||
this.Size = new System.Drawing.Size(250, 50);
|
||||
((System.ComponentModel.ISupportInitialize)(this.linePanel)).EndInit();
|
||||
this.linePanel.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl linePanel;
|
||||
private DevExpress.XtraEditors.LabelControl line;
|
||||
private DevExpress.XtraEditors.LabelControl imageLabel;
|
||||
private DevExpress.XtraEditors.LabelControl simplebButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.ProductDynamic.Controls
|
||||
{
|
||||
public partial class ImageButton : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// this label控件
|
||||
/// </summary>
|
||||
private DevExpress.XtraEditors.LabelControl _imageLabel;
|
||||
public DevExpress.XtraEditors.LabelControl ImageLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
_imageLabel = this.imageLabel;
|
||||
return _imageLabel;
|
||||
}
|
||||
set { _imageLabel = value; }
|
||||
}
|
||||
private DevExpress.XtraEditors.LabelControl _simpleButton;
|
||||
/// <summary>
|
||||
/// this simpleButton控件
|
||||
/// </summary>
|
||||
public DevExpress.XtraEditors.LabelControl SimpleButton
|
||||
{
|
||||
get
|
||||
{
|
||||
_simpleButton = this.simplebButton;
|
||||
return _simpleButton;
|
||||
}
|
||||
set { _simpleButton = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 按钮模型
|
||||
/// </summary>
|
||||
public ProductDynamicBtnModel productDynamicBtnModel;
|
||||
public ImageButton(DataRow row)
|
||||
{
|
||||
InitializeComponent();
|
||||
productDynamicBtnModel = new ProductDynamicBtnModel(row);
|
||||
this.Load += new EventHandler(OnImageButton_Load);
|
||||
this.SimpleButton.MouseMove += new MouseEventHandler(OnSimpleButton_MouseMove);
|
||||
this.simplebButton.MouseLeave += new EventHandler(OnSimplebButton_MouseLeave);
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗体加载时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnImageButton_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.imageLabel.Width = this.Height;
|
||||
this.simplebButton.BackColor = this.BackColor;
|
||||
if (productDynamicBtnModel != null)
|
||||
{
|
||||
this.simplebButton.Text = productDynamicBtnModel.ProductName;
|
||||
try
|
||||
{
|
||||
//this.imageLabel.Appearance.Image = productDynamicBtnModel.ProductPic;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 鼠标离开事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSimplebButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
DevExpress.XtraEditors.LabelControl labelBtn = (DevExpress.XtraEditors.LabelControl)sender;
|
||||
labelBtn.BackColor = Color.Transparent;
|
||||
}
|
||||
/// <summary>
|
||||
/// 鼠标滑过事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSimpleButton_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
DevExpress.XtraEditors.LabelControl labelBtn = (DevExpress.XtraEditors.LabelControl)sender;
|
||||
labelBtn.BackColor = ColorTranslator.FromHtml("#eac205");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.ProductDynamic.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 动态按钮模型
|
||||
/// </summary>
|
||||
public class ProductDynamicBtnModel
|
||||
{
|
||||
private string productName;
|
||||
private string productPic;
|
||||
private string productTip;
|
||||
private string detailId;
|
||||
private string dynamicSql;
|
||||
private int productState;
|
||||
private string errorMessage;
|
||||
#region 公有变量
|
||||
public string ProductName { get { return productName; } set { productName = value; } }
|
||||
public string ProductPic { get { return productPic; } set { productPic = value; } }
|
||||
public string ProductTip { get { return productTip; } set { productTip = value; } }
|
||||
public string DetailId { get { return detailId; } set { detailId = value; } }
|
||||
public string DynamicSql { get { return dynamicSql; } set { dynamicSql = value; } }
|
||||
public int ProductState { get { return productState; } set { productState = value; } }
|
||||
public string ErrorMessage { get { return errorMessage; } set { errorMessage = value; } }
|
||||
|
||||
#endregion
|
||||
public ProductDynamicBtnModel(DataRow row)
|
||||
{
|
||||
productName = row.Table.Columns.Contains("ProductName") ? row["ProductName"] + "" : "";
|
||||
productPic = row.Table.Columns.Contains("ProductPic") ? row["ProductPic"] + "" : "";
|
||||
productTip = row.Table.Columns.Contains("ProductTip") ? row["ProductTip"] + "" : "";
|
||||
detailId = row.Table.Columns.Contains("DetailId") ? row["DetailId"] + "" : "";
|
||||
dynamicSql = row.Table.Columns.Contains("DynamicSql") ? row["DynamicSql"] + "" : "";
|
||||
productState = row.Table.Columns.Contains("ProductState") && !string.IsNullOrEmpty(row["ProductState"] + "") ? int.TryParse(row["ProductState"] + "", out productState) ? Convert.ToInt32(row["ProductState"] + "") : 0 : 0;
|
||||
errorMessage = row.Table.Columns.Contains("ErrorMessage") ? row["ErrorMessage"] + "" : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=6.1.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.ProgressBarControl, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -1810,4 +1810,33 @@ namespace Lskj.AutoCreatWord
|
||||
|
||||
// 创建新的 DataTable 用于存储分组结果
|
||||
DataTable groupedTable = selectTable.Clone();
|
||||
|
||||
foreach (var group in groupedData)
|
||||
{
|
||||
// 将动态键拆分成各个部分,并添加到新行
|
||||
object[] keyParts = Regex.Split(group.Key.Key, separator);
|
||||
DataRow newRow = groupedTable.NewRow();
|
||||
for (int i = 0; i < keyParts.Length; i++)
|
||||
{
|
||||
newRow[groupByColumns[i]] = keyParts[i];
|
||||
}
|
||||
groupedTable.Rows.Add(newRow);
|
||||
}
|
||||
dataTable = groupedTable;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///word表格数据配置的集合
|
||||
/// </summary>
|
||||
protected class GridTarGet
|
||||
{
|
||||
public string number;
|
||||
public Section targetSection;
|
||||
public Table targetTable;
|
||||
public int rowIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,30 @@ namespace Lskj.AutoWordFile
|
||||
AutoCreatWord.CreateWordUtil.DbOperator = new Lskj.Data.ADO.Template.DbTemplate(string.Format("server={0};database={1};persist security info=true;user id=lserpAdmin;password=lserp110;max pool size = 512;", DBConfig.Instance.ServerName, DBConfig.Instance.DataBase), "system.data.sqlclient");
|
||||
string[] masterSqls = Model.MasterSql.Trim('^').Split('^');
|
||||
List<DataSet> dataSets = new List<DataSet>();
|
||||
for
|
||||
foreach (string masterSql in masterSqls)
|
||||
{
|
||||
if (string.IsNullOrEmpty(masterSql)) continue;
|
||||
dataSets.Add(SqlHelper.ExecuteDataSet(masterSql));
|
||||
}
|
||||
AutoCreatWord.CreateWordUtil.Create(mainTempPath, menuTempPath, Model.MenuTempArray, dataSets, savePdfPath, SystemInfo.Instance.OAUrl, out string msg);
|
||||
cts.Cancel();
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
progressBar1.Value = 100;
|
||||
Process.Start(savePdfPath);
|
||||
Close();
|
||||
}));
|
||||
}
|
||||
});
|
||||
crateTask.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+27
-1
@@ -220,4 +220,30 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
thi
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Splitter splitter1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Splitter splitter2;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.RichTextBox richTextBox;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,4 +60,34 @@ namespace Lskj.AutoUpdate
|
||||
this.panel4.Visible = false;
|
||||
this.Height = this.Height - this.panel4.Height;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:窗口加载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnLoad(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
foreach (DownloadFileInfo file in this.downloadFileList)
|
||||
{
|
||||
ListViewItem item = new ListViewItem(new string[] { file.FileName, file.LastVersion, file.Size.ToString() });
|
||||
}
|
||||
this.Activate();
|
||||
this.Focus();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+318
-112
@@ -1,11 +1,11 @@
|
||||
/******************************
|
||||
* 说明:下载进度窗口
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-02-09
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
/******************************
|
||||
* 说明:下载进度窗口
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-02-09
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,38 +22,45 @@ using System.Net;
|
||||
namespace Lskj.AutoUpdate
|
||||
{
|
||||
/// <summary>
|
||||
/// 下载进度窗口
|
||||
/// 下载进度窗口
|
||||
/// </summary>
|
||||
public partial class FrmProgress : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否下载完成
|
||||
/// 是否下载完成
|
||||
/// </summary>
|
||||
private bool isFinished = false;
|
||||
/// <summary>
|
||||
/// 下载总数
|
||||
/// 下载总数
|
||||
/// </summary>
|
||||
private long total = 0;
|
||||
/// <summary>
|
||||
/// 当前下载的总数
|
||||
/// 当前下载的总数
|
||||
/// </summary>
|
||||
private long nDownloadedTotal = 0;
|
||||
/// <summary>
|
||||
/// 下载文件列表
|
||||
/// 下载文件列表
|
||||
/// </summary>
|
||||
private List<DownloadFileInfo> downloadFileList = new List<DownloadFileInfo>();
|
||||
/// <summary>
|
||||
/// 所有文件列表
|
||||
/// 所有文件列表
|
||||
/// </summary>
|
||||
private List<DownloadFileInfo> allFileList = null;
|
||||
private ManualResetEvent evtDownload = null;
|
||||
private ManualResetEvent evtPerDonwload = null;
|
||||
private WebClient clientDownload = null;
|
||||
private AutoUpdater autoUpdater = null;
|
||||
private bool isUserCanceled = false;
|
||||
private bool isClosingByCode = false;
|
||||
private delegate void SetProcessBarCallBack(int current, int total);
|
||||
private delegate void ExitCallBack(bool success);
|
||||
private delegate void ShowCurrentDownloadFileNameCallBack(string name);
|
||||
|
||||
public bool IsUserCanceled
|
||||
{
|
||||
get { return isUserCanceled; }
|
||||
}
|
||||
|
||||
public FrmProgress(List<DownloadFileInfo> downloadFileListTemp, AutoUpdater apd)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -65,7 +72,7 @@ namespace Lskj.AutoUpdate
|
||||
|
||||
//foreach (DownloadFileInfo item in downloadFileListTemp)
|
||||
//{
|
||||
// // 本地临时文件夹中不存在此文件则下载.
|
||||
// // 本地临时文件夹中不存在此文件则下载.
|
||||
// string tempUrlPath = CommonUnitity.GetFolderUrl(item);
|
||||
// tempUrlPath = Path.Combine(CommonUnitity.SystemBinUrl + ConstModel.TEMP_FOLDER_NAME + tempUrlPath, item.FileName);
|
||||
// if (!File.Exists(tempUrlPath))
|
||||
@@ -73,17 +80,17 @@ namespace Lskj.AutoUpdate
|
||||
// this.downloadFileList.Add(item);
|
||||
// }
|
||||
//}
|
||||
this.lblAll.Text = string.Format("总进度(0/{0})", this.downloadFileList.Count);
|
||||
this.lblAll.Text = string.Format("总进度(0/{0})", this.downloadFileList.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:窗口加载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:窗口加载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
@@ -94,40 +101,45 @@ namespace Lskj.AutoUpdate
|
||||
ThreadPool.QueueUserWorkItem(new WaitCallback(this.ProcDownload));
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="FormClosingEventArgs"/> instance containing the event data.</param>
|
||||
private void OnFormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (!isFinished && DialogResult.Yes == MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
|
||||
if (isClosingByCode)
|
||||
{
|
||||
e.Cancel = true;
|
||||
ReleaseDownloadWait();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (clientDownload != null)
|
||||
clientDownload.CancelAsync();
|
||||
|
||||
evtDownload.Set();
|
||||
evtPerDonwload.Set();
|
||||
if (!isFinished && !isUserCanceled)
|
||||
{
|
||||
if (DialogResult.Yes != MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
||||
CancelUpdate(true);
|
||||
}
|
||||
|
||||
ReleaseDownloadWait();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:下载文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:下载文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="o">The o.</param>
|
||||
private void ProcDownload(object o)
|
||||
@@ -148,12 +160,15 @@ namespace Lskj.AutoUpdate
|
||||
|
||||
while (!evtDownload.WaitOne(0, false))
|
||||
{
|
||||
if (isUserCanceled)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
if (this.downloadFileList.Count == 0)
|
||||
break;
|
||||
|
||||
this.lblAll.Text = string.Format("总进度({0}/{1})", count - this.downloadFileList.Count, count);
|
||||
this.lblAll.Text = string.Format("总进度({0}/{1})", count - this.downloadFileList.Count, count);
|
||||
DownloadFileInfo file = this.downloadFileList[0];
|
||||
|
||||
|
||||
@@ -174,7 +189,7 @@ namespace Lskj.AutoUpdate
|
||||
{
|
||||
try
|
||||
{
|
||||
//this.Text = "接收:" + e.BytesReceived.ToString() + " 字节数:" + progressBarCurrent.Maximum.ToString();
|
||||
//this.Text = "接收:" + e.BytesReceived.ToString() + " 字节数:" + progressBarCurrent.Maximum.ToString();
|
||||
progressBarCurrent.Value = (int)e.BytesReceived / progressBarCurrent.Maximum;
|
||||
progressBarTotal.Value = (int)((nDownloadedTotal + e.BytesReceived) * 100 / total);
|
||||
this.SetProcessBar(e.ProgressPercentage, (int)((nDownloadedTotal + e.BytesReceived) * 100 / total));
|
||||
@@ -191,6 +206,15 @@ namespace Lskj.AutoUpdate
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isUserCanceled || e.Cancelled)
|
||||
{
|
||||
evtPerDonwload.Set();
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Error != null)
|
||||
throw e.Error;
|
||||
|
||||
DealWithDownloadErrors();
|
||||
DownloadFileInfo dfile = e.UserState as DownloadFileInfo;
|
||||
nDownloadedTotal += dfile.Size;
|
||||
@@ -199,7 +223,13 @@ namespace Lskj.AutoUpdate
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
MessageBox.Show("下载错误202:" + exp.Message);
|
||||
if (!isUserCanceled)
|
||||
{
|
||||
DownloadFileInfo dfile = e.UserState as DownloadFileInfo;
|
||||
MessageBox.Show(BuildDownloadErrorMessage(dfile, exp), ConstModel.LS_TITLE_NAME, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
evtPerDonwload.Set();
|
||||
ShowErrorAndRestartApplication();
|
||||
}
|
||||
//log the error message,you can use the application's log code
|
||||
}
|
||||
|
||||
@@ -223,6 +253,9 @@ namespace Lskj.AutoUpdate
|
||||
//Wait for the download complete
|
||||
evtPerDonwload.WaitOne();
|
||||
|
||||
if (isUserCanceled)
|
||||
return;
|
||||
|
||||
clientDownload.Dispose();
|
||||
clientDownload = null;
|
||||
|
||||
@@ -231,11 +264,19 @@ namespace Lskj.AutoUpdate
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(this.downloadFileList[0].FileName + "\r\n" + e.Message);
|
||||
ShowErrorAndRestartApplication();
|
||||
if (!isUserCanceled)
|
||||
{
|
||||
DownloadFileInfo file = this.downloadFileList.Count > 0 ? this.downloadFileList[0] : null;
|
||||
MessageBox.Show(BuildDownloadErrorMessage(file, e), ConstModel.LS_TITLE_NAME, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
ShowErrorAndRestartApplication();
|
||||
}
|
||||
//throw;
|
||||
}
|
||||
}
|
||||
if (isUserCanceled)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
//When the files have not downloaded,return.
|
||||
if (downloadFileList.Count > 0)
|
||||
@@ -247,6 +288,7 @@ namespace Lskj.AutoUpdate
|
||||
DealWithDownloadErrors();
|
||||
|
||||
//Debug.WriteLine("All Downloaded");
|
||||
bool replaceSuccess = true;
|
||||
foreach (DownloadFileInfo file in this.allFileList)
|
||||
{
|
||||
string tempUrlPath = CommonUnitity.GetFolderUrl(file);
|
||||
@@ -269,7 +311,7 @@ namespace Lskj.AutoUpdate
|
||||
System.IO.FileInfo f = new FileInfo(newPath);
|
||||
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
|
||||
{
|
||||
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
|
||||
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
|
||||
ShowErrorAndRestartApplication();
|
||||
}
|
||||
|
||||
@@ -320,7 +362,9 @@ namespace Lskj.AutoUpdate
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
MessageBox.Show("oldPath:" + oldPath + "\r\n" + "newPath:" + newPath + "\r\n" + exp.Message);
|
||||
replaceSuccess = false;
|
||||
MessageBox.Show("oldPath:" + oldPath + "\r\n" + "newPath:" + newPath + "\r\n" + exp.Message);
|
||||
break;
|
||||
//log the error message,you can use the application's log code
|
||||
}
|
||||
|
||||
@@ -329,7 +373,7 @@ namespace Lskj.AutoUpdate
|
||||
//After dealed with all files, clear the data
|
||||
this.allFileList.Clear();
|
||||
|
||||
if (this.downloadFileList.Count == 0)
|
||||
if (this.downloadFileList.Count == 0 && replaceSuccess)
|
||||
Exit(true);
|
||||
else
|
||||
Exit(false);
|
||||
@@ -337,41 +381,58 @@ namespace Lskj.AutoUpdate
|
||||
evtDownload.Set();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:移动文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:移动文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="oldPath">The old path.</param>
|
||||
/// <param name="newPath">The new path.</param>
|
||||
private void MoveFolderToOld(string oldPath, string newPath)
|
||||
{
|
||||
Exception lastException = null;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(oldPath + ".old"))
|
||||
System.IO.File.SetAttributes(oldPath + ".old", System.IO.FileAttributes.Normal);
|
||||
if (File.Exists(oldPath))
|
||||
System.IO.File.SetAttributes(oldPath, System.IO.FileAttributes.Normal);
|
||||
|
||||
if (File.Exists(oldPath + ".old"))
|
||||
System.IO.File.SetAttributes(oldPath + ".old", System.IO.FileAttributes.Normal);
|
||||
if (File.Exists(oldPath))
|
||||
System.IO.File.SetAttributes(oldPath, System.IO.FileAttributes.Normal);
|
||||
|
||||
if (File.Exists(oldPath + ".old"))
|
||||
File.Delete(oldPath + ".old");
|
||||
|
||||
if (File.Exists(oldPath))
|
||||
File.Move(oldPath, oldPath + ".old");
|
||||
File.Move(newPath, oldPath);
|
||||
if (File.Exists(oldPath + ".old"))
|
||||
File.Delete(oldPath + ".old");
|
||||
|
||||
if (File.Exists(oldPath))
|
||||
File.Move(oldPath, oldPath + ".old");
|
||||
File.Move(newPath, oldPath);
|
||||
return;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
lastException = ex;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
lastException = ex;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
throw new IOException("文件可能仍被其他进程占用,重试后仍无法替换:" + oldPath, lastException);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:显示当前下载文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:显示当前下载文件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
private void ShowCurrentDownloadFileName(string name)
|
||||
@@ -380,21 +441,21 @@ namespace Lskj.AutoUpdate
|
||||
{
|
||||
ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName);
|
||||
this.Invoke(cb, new object[] { name });
|
||||
this.labelCurrentItem.Text = "正在更新:" + name;
|
||||
this.labelCurrentItem.Text = "正在更新:" + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.labelCurrentItem.Text = "正在更新:" + name;
|
||||
this.labelCurrentItem.Text = "正在更新:" + name;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:显示当前进度</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:显示当前进度</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="current">The current.</param>
|
||||
/// <param name="total">The total.</param>
|
||||
@@ -412,13 +473,13 @@ namespace Lskj.AutoUpdate
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:退出升级程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:退出升级程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="success">if set to <c>true</c> [success].</param>
|
||||
private void Exit(bool success)
|
||||
@@ -430,40 +491,42 @@ namespace Lskj.AutoUpdate
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isClosingByCode = true;
|
||||
this.isFinished = success;
|
||||
this.DialogResult = success ? DialogResult.OK : DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:取消</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:取消</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void OnCancel(object sender, EventArgs e)
|
||||
{
|
||||
if (isUserCanceled)
|
||||
return;
|
||||
|
||||
if (!isFinished && DialogResult.Yes == MessageBox.Show(ConstModel.UPDATE_GIVING_UP, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
|
||||
{
|
||||
evtDownload.Set();
|
||||
evtPerDonwload.Set();
|
||||
autoUpdater.RollBack();
|
||||
CancelUpdate(true);
|
||||
Exit(false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:下载失败</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:下载失败</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void DealWithDownloadErrors()
|
||||
{
|
||||
@@ -478,4 +541,147 @@ namespace Lskj.AutoUpdate
|
||||
{
|
||||
//MessageBox.Show(e.Message);
|
||||
//log the error message,you can use the application's log code
|
||||
ShowErrorAndRestartApp
|
||||
ShowErrorAndRestartApplication();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 将WebClient下载异常转换为用户可理解的提示。
|
||||
/// </summary>
|
||||
/// <param name="file">下载文件信息。</param>
|
||||
/// <param name="ex">下载异常。</param>
|
||||
/// <returns>友好的错误提示。</returns>
|
||||
private string BuildDownloadErrorMessage(DownloadFileInfo file, Exception ex)
|
||||
{
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.AppendLine("更新文件下载失败。");
|
||||
if (file != null)
|
||||
{
|
||||
message.AppendLine("文件:" + file.FileName);
|
||||
message.AppendLine("地址:" + file.DownloadUrl);
|
||||
}
|
||||
message.AppendLine("原因:" + GetFriendlyDownloadExceptionMessage(ex));
|
||||
message.AppendLine();
|
||||
message.AppendLine("请检查网络是否正常、更新服务器是否可访问,或关闭防火墙/杀毒软件拦截后重试。");
|
||||
return message.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下载异常的具体原因。
|
||||
/// </summary>
|
||||
/// <param name="ex">异常对象。</param>
|
||||
/// <returns>异常原因说明。</returns>
|
||||
private string GetFriendlyDownloadExceptionMessage(Exception ex)
|
||||
{
|
||||
WebException webException = ex as WebException;
|
||||
if (webException == null && ex != null)
|
||||
{
|
||||
webException = ex.InnerException as WebException;
|
||||
}
|
||||
|
||||
if (webException != null)
|
||||
{
|
||||
HttpWebResponse response = webException.Response as HttpWebResponse;
|
||||
if (response != null)
|
||||
{
|
||||
if (response.StatusCode == HttpStatusCode.ProxyAuthenticationRequired)
|
||||
{
|
||||
return "代理服务器需要认证,请检查系统代理账号或网络代理设置。";
|
||||
}
|
||||
if (response.StatusCode == HttpStatusCode.NotFound)
|
||||
{
|
||||
return "服务器上找不到该更新文件,请确认更新包是否已上传完整。";
|
||||
}
|
||||
if (response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
return "服务器拒绝访问该更新文件,请检查文件权限或更新地址配置。";
|
||||
}
|
||||
return string.Format("服务器返回 {0} {1},请确认更新文件是否存在或服务器权限是否正确。", (int)response.StatusCode, response.StatusDescription);
|
||||
}
|
||||
|
||||
switch (webException.Status)
|
||||
{
|
||||
case WebExceptionStatus.NameResolutionFailure:
|
||||
return "无法解析更新服务器地址,请检查DNS、网络连接或服务器地址配置。";
|
||||
case WebExceptionStatus.ConnectFailure:
|
||||
return "无法连接更新服务器,请检查网络、服务器端口或防火墙设置。";
|
||||
case WebExceptionStatus.Timeout:
|
||||
return "连接更新服务器超时,可能是网络不稳定或服务器响应过慢。";
|
||||
case WebExceptionStatus.ProxyNameResolutionFailure:
|
||||
return "代理服务器地址解析失败,请检查系统代理设置。";
|
||||
case WebExceptionStatus.TrustFailure:
|
||||
case WebExceptionStatus.SecureChannelFailure:
|
||||
return "安全连接失败,请检查服务器证书或客户端系统时间。";
|
||||
case WebExceptionStatus.ConnectionClosed:
|
||||
return "下载过程中连接被关闭,可能是网络中断或服务器主动断开。";
|
||||
case WebExceptionStatus.ProtocolError:
|
||||
return "服务器返回了错误响应,请确认更新地址和文件权限。";
|
||||
default:
|
||||
return webException.Message;
|
||||
}
|
||||
}
|
||||
|
||||
if (ex is UriFormatException)
|
||||
{
|
||||
return "更新文件地址格式不正确。";
|
||||
}
|
||||
if (ex is UnauthorizedAccessException)
|
||||
{
|
||||
return "没有写入更新文件的权限,请以管理员身份运行或检查目录权限。";
|
||||
}
|
||||
if (ex is IOException)
|
||||
{
|
||||
return "写入更新文件失败,可能是文件被占用或磁盘空间不足。";
|
||||
}
|
||||
|
||||
return ex != null ? ex.Message : "未知错误。";
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:重新下载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void ShowErrorAndRestartApplication()
|
||||
{
|
||||
DialogResult dlg = MessageBox.Show(ConstModel.UPDATE_CONTINUE, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (dlg == DialogResult.Yes)
|
||||
CommonUnitity.RestartApplication();
|
||||
else
|
||||
{
|
||||
if (clientDownload != null)
|
||||
clientDownload.CancelAsync();
|
||||
ReleaseDownloadWait();
|
||||
autoUpdater.RollBack();
|
||||
|
||||
Exit(false);
|
||||
}
|
||||
}
|
||||
private void CancelUpdate(bool rollback)
|
||||
{
|
||||
isUserCanceled = true;
|
||||
|
||||
if (clientDownload != null)
|
||||
clientDownload.CancelAsync();
|
||||
|
||||
ReleaseDownloadWait();
|
||||
|
||||
if (rollback)
|
||||
autoUpdater.RollBack(true);
|
||||
}
|
||||
|
||||
private void ReleaseDownloadWait()
|
||||
{
|
||||
if (evtDownload != null)
|
||||
evtDownload.Set();
|
||||
|
||||
if (evtPerDonwload != null)
|
||||
evtPerDonwload.Set();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -59,4 +59,35 @@ namespace Lskj.AutoUpdate
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="file">The file.</param>
|
||||
/// <
|
||||
/// <returns>Config.</returns>
|
||||
public Config LoadConfig(string file)
|
||||
{
|
||||
if (!File.Exists(file)) SaveConfig(file);
|
||||
|
||||
XmlSerializer xs = new XmlSerializer(typeof(Config));
|
||||
StreamReader sr = new StreamReader(file);
|
||||
Config config = xs.Deserialize(sr) as Config;
|
||||
sr.Close();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:保存配置</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="file">The file.</param>
|
||||
public void SaveConfig(string file)
|
||||
{
|
||||
XmlSerializer xs = new XmlSerializer(typeof(Config));
|
||||
StreamWriter sw = new StreamWriter(file);
|
||||
xs.Serialize(sw, this);
|
||||
sw.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/******************************
|
||||
* 说明:启动进程、关闭进程操作
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-02-09
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
/******************************
|
||||
* 说明:启动进程、关闭进程操作
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-02-09
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,18 +16,18 @@ using System.Diagnostics;
|
||||
namespace Lskj.AutoUpdate
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动进程、关闭进程操作
|
||||
/// 启动进程、关闭进程操作
|
||||
/// </summary>
|
||||
public class ProcessManager
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>说明:初始化更新,关闭现有软件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:初始化更新,关闭现有软件</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void InitUpdateEnvironment()
|
||||
{
|
||||
@@ -42,13 +42,13 @@ namespace Lskj.AutoUpdate
|
||||
CloseExe(ConstModel.Ls_Notice);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:启动主程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:启动主程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void StartProcess(bool isMes = false)
|
||||
{
|
||||
@@ -70,13 +70,13 @@ namespace Lskj.AutoUpdate
|
||||
CloseExe(ConstModel.LS_UPDATE_NAME);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:启动更新程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:启动更新程序</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void StartUpdateProcess(bool isMes = false)
|
||||
{
|
||||
@@ -99,13 +99,13 @@ namespace Lskj.AutoUpdate
|
||||
CloseExe(ConstModel.Ls_Notice);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:启动exe绝对路径</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:启动exe绝对路径</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="filePath">The file path.</param>
|
||||
/// <param name="fileName">Name of the file.</param
|
||||
@@ -113,8 +113,8 @@ namespace Lskj.AutoUpdate
|
||||
private void StartExe(string filePath, string fileName, string args = "")
|
||||
{
|
||||
Process proc = new Process();
|
||||
proc.StartInfo.UseShellExecute = true;//是否使用操作系统外壳程序启动进程
|
||||
proc.StartInfo.WorkingDirectory = filePath;//启动进程的初始目录
|
||||
proc.StartInfo.UseShellExecute = true;//是否使用操作系统外壳程序启动进程
|
||||
proc.StartInfo.WorkingDirectory = filePath;//启动进程的初始目录
|
||||
proc.StartInfo.FileName = fileName;
|
||||
if (!string.IsNullOrEmpty(args))
|
||||
{
|
||||
@@ -123,29 +123,79 @@ namespace Lskj.AutoUpdate
|
||||
proc.Start();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:关闭的exe进程名</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:关闭的exe进程名</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="exeName">Name of the executable.</param>
|
||||
public void CloseExe(string exeName)
|
||||
{
|
||||
Process[] arrPro = Process.GetProcessesByName(exeName);
|
||||
int currentProcessId = Process.GetCurrentProcess().Id;
|
||||
foreach (Process pro in arrPro)
|
||||
pro.Kill();
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pro.Id == currentProcessId)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
if (!pro.HasExited)
|
||||
{
|
||||
pro.Kill();
|
||||
pro.WaitForExit(10000);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 关闭失败时继续处理其他进程,后续文件替换阶段会再次检测文件占用。
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
pro.Dispose();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Process[] arrPro = Process.GetProcessesByName(exeName);
|
||||
//foreach (Process pro in arrPro)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (!pro.HasExited)
|
||||
// pro.Kill();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// // Kill 失败不抛异常,记录日志,更新继续
|
||||
// //LogHelper.Instance.WriteError("关闭进程 " + exeName + " 失败: " + ex.Message);
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// try { pro.Dispose(); }
|
||||
// catch { }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:是否存在进程名</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// <para>说明:是否存在进程名</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-02-09 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="processName">Name of the process.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
|
||||
@@ -71,4 +71,29 @@ namespace Lskj.BaseAccraditation
|
||||
return;
|
||||
}
|
||||
FrmBaseAccraditation popupForm = new FrmBaseAccraditation();
|
||||
popupForm.SysModel = DynamicBaseM
|
||||
popupForm.SysModel = DynamicBaseModel;
|
||||
popupForm.Opacity = 0;
|
||||
popupForm.SysModel.DataCaches = new Dictionary<object, Hashtable>();
|
||||
if (SystemInfo.Instance.OptimizationSpeed) popupForm.GetDataCaches(popupForm.SysModel.DataCaches);
|
||||
this.SubForm = popupForm;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmMain main = new FrmMain();
|
||||
this.SubForm = main;
|
||||
main.SysModel = new DynamicBaseAccraditionModel(obj);
|
||||
main.SysModel.DataCaches = new Dictionary<object, Hashtable>();
|
||||
if (SystemInfo.Instance.OptimizationSpeed) main.GetDataCaches(main.SysModel.DataCaches);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogUtil.WriteError("Lskj.BaseAccraditation.dll--参数错误-->" + obj.ToString(), ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Form SubForm { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+18
-1
@@ -649,4 +649,21 @@
|
||||
private DevExpress.XtraBars.PopupMenu pMprint;
|
||||
private DevExpress.XtraEditors.PanelControl pl_right_bottom;
|
||||
private DevExpress.XtraEditors.PanelControl pl_right_bottom2;
|
||||
private DevExpress.XtraEd
|
||||
private DevExpress.XtraEditors.SimpleButton btnRemindBack;
|
||||
private DevExpress.XtraEditors.SimpleButton btnRemindAccradit;
|
||||
private Control.LabelDateEdit labeldate_happendTime;
|
||||
private DevExpress.XtraEditors.SimpleButton btnAudit;
|
||||
private DevExpress.XtraEditors.SimpleButton btnClose;
|
||||
private Control.LabelTextEdit labeltxt_managerAudit;
|
||||
private Control.LabelComboxEdit combox_Suggestion;
|
||||
private DevExpress.XtraEditors.SimpleButton btnReturnd;
|
||||
private DevExpress.XtraEditors.PanelControl pl_right_center;
|
||||
private System.Windows.Forms.TextBox txt_remark;
|
||||
private DevExpress.XtraEditors.LabelControl label_auditPerson;
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitContainer;
|
||||
private DevExpress.XtraEditors.XtraScrollableControl pl_main;
|
||||
private DevExpress.XtraEditors.LabelControl label_status;
|
||||
private Control.TabControlEx tab_basicInfo;
|
||||
private DevExpress.XtraEditors.DropDownButton btnPrint;
|
||||
}
|
||||
}
|
||||
@@ -2887,3 +2887,33 @@ namespace Lskj.BaseAccraditation
|
||||
|
||||
Object moduleObject = tabPage.Controls.Cast<Object>().FirstOrDefault();
|
||||
if (moduleObject is ModuleGridEx)
|
||||
{
|
||||
ModuleGridEx moduleGridEx = moduleObject as ModuleGridEx;
|
||||
if (moduleGridEx.GridControlObj.IsDataNotSaved() && moduleGridEx.BtnSave.Visible && moduleGridEx.BtnSave.Enabled)
|
||||
{
|
||||
moduleGridEx.BtnSave.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置修改过的控件颜色
|
||||
/// </summary>
|
||||
public void SetColor()
|
||||
{
|
||||
List<string> FieldList = AuditChangeLog.GetChangeLogFields(this.SysModel.PrimaryValue);
|
||||
foreach (string item in FieldList)
|
||||
{
|
||||
this.ControlObj.SetBackgroundColor(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,4 +509,25 @@ namespace Lskj.BaseAccraditation
|
||||
/// <para>创建日期:2021-11-23 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改��
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void refreshThePage(string promptInformation, string id)
|
||||
{
|
||||
this.auditPanelObj.RefreshTabPage();
|
||||
if (!string.IsNullOrWhiteSpace(promptInformation)) MessageUtil.Show(promptInformation);
|
||||
//上一次点开page
|
||||
XtraTabPage beforePage = ERPInfo.Instance.ModuleForms[id].BeforePage;
|
||||
//要删除的page
|
||||
XtraTabPage removePage = new XtraTabPage();
|
||||
ERPInfo.Instance.ModuleForms.Remove(id);
|
||||
foreach (XtraTabPage tablepage in ERPInfo.Instance.PageControl.TabPages)
|
||||
{
|
||||
if (tablepage.Tag == null) continue;
|
||||
if (tablepage.Tag.ToString().Equals(id)) removePage = tablepage;
|
||||
if (tablepage == beforePage) ERPInfo.Instance.PageControl.SelectedTabPage = beforePage;
|
||||
}
|
||||
ERPInfo.Instance.PageControl.TabPages.Remove(removePage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -1089,4 +1089,36 @@ namespace Lskj.BaseInfo
|
||||
MessageUtil.Show(ResourceKeys.ForcedSuccess);
|
||||
//暂未推送消息
|
||||
PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this._stepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId);
|
||||
push.Push_Base_Oper_Message();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void simpleButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
WebBrowserUtil.StartWebBrowser(this.SysModel.ModuleCode, mRowItem["ToolsName"] + "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -0,0 +1,2 @@
|
||||
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -474,4 +474,36 @@ namespace Lskj.BaseWorkflow.Control
|
||||
int? maxStepCode = BaseflowModelList
|
||||
.Where(m => m.stepCode < selectedStepCode)
|
||||
.Select(m => m.stepCode)
|
||||
.DefaultIfEmpty
|
||||
.DefaultIfEmpty() // 避免空集合时抛出异常
|
||||
.Max();
|
||||
|
||||
Code = (int)(maxStepCode + (selectedStepCode - maxStepCode) / 2);
|
||||
}
|
||||
BaseflowModel model = new BaseflowModel
|
||||
{
|
||||
stepCode = Convert.ToInt32(Code),
|
||||
typeCode = mMenuCode,
|
||||
stepGroup = stepGroup,
|
||||
stepName = stepName,
|
||||
stepApplyText = "审核(&Y)",
|
||||
stepApplyContent = "同意",
|
||||
stepBackText = "反退(&N)",
|
||||
stepBackContent = "不同意",
|
||||
};
|
||||
try
|
||||
{
|
||||
// 保存
|
||||
if (WorkFlowBaseImpl.SaveBaseFlow(model))
|
||||
{
|
||||
// 重排列表
|
||||
InitializeStepFlow();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show("保存失败!" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -500,4 +500,21 @@
|
||||
private DevExpress.XtraEditors.PanelControl panelControl4;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private DevExpress.XtraTab.XtraTabControl xtraTabControl2;
|
||||
private DevExpress.XtraTab.XtraTabPage
|
||||
private DevExpress.XtraTab.XtraTabPage xtraTabPage3;
|
||||
public DevExpress.XtraGrid.GridControl gridControl1;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView2;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView3;
|
||||
private DevExpress.XtraTab.XtraTabPage xtraTabPage4;
|
||||
public DevExpress.XtraGrid.GridControl gridControl;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl6;
|
||||
private Lskj.Control.LabelTextEdit labelTextEdit1;
|
||||
private Lskj.Control.LabelComboxEdit labelComboxEdit1;
|
||||
private DevExpress.XtraEditors.XtraScrollableControl xtraScrollableControl1;
|
||||
private Lskj.Control.LabelCheckEdit labdisable;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user