基线 SVN r240

SVN-Revision: r240
This commit is contained in:
cyf
2025-02-06 06:46:06 +00:00
commit ab56a9bcf7
5317 changed files with 902274 additions and 0 deletions
+690
View File
@@ -0,0 +1,690 @@
namespace Lskj.PubPrint
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.PrintAfterTable = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.PrintTable = new DevExpress.XtraGrid.GridControl();
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
this.id = new DevExpress.XtraGrid.Columns.GridColumn();
this.modid = new DevExpress.XtraGrid.Columns.GridColumn();
this.PrintCount = new DevExpress.XtraGrid.Columns.GridColumn();
this.libaryName = new DevExpress.XtraGrid.Columns.GridColumn();
this.printKeyvalue = new DevExpress.XtraGrid.Columns.GridColumn();
this.printModuleName = new DevExpress.XtraGrid.Columns.GridColumn();
this.printerName = new DevExpress.XtraGrid.Columns.GridColumn();
this.printSQL = new DevExpress.XtraGrid.Columns.GridColumn();
this.printSQL1 = new DevExpress.XtraGrid.Columns.GridColumn();
this.printSQL2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.printSQL3 = new DevExpress.XtraGrid.Columns.GridColumn();
this.printFlag = new DevExpress.XtraGrid.Columns.GridColumn();
this.printTime = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
this.createTime = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemTimeEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
this.panel2 = new System.Windows.Forms.Panel();
this.Afterprint = new DevExpress.XtraGrid.GridControl();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn14 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemTextEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn();
this.repositoryItemTimeEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit();
this.timer1 = new System.Windows.Forms.Timer();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.lab_Sql = new Lskj.Control.LabelMemoEdit();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.txt_timer = new DevExpress.XtraEditors.TextEdit();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.txtLog = new System.Windows.Forms.TextBox();
this.timer2 = new System.Windows.Forms.Timer();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon();
((System.ComponentModel.ISupportInitialize)(this.PrintAfterTable)).BeginInit();
this.PrintAfterTable.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PrintTable)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit1)).BeginInit();
this.xtraTabPage2.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Afterprint)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txt_timer.Properties)).BeginInit();
this.SuspendLayout();
//
// PrintAfterTable
//
this.PrintAfterTable.Dock = System.Windows.Forms.DockStyle.Top;
this.PrintAfterTable.Location = new System.Drawing.Point(0, 0);
this.PrintAfterTable.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.PrintAfterTable.Name = "PrintAfterTable";
this.PrintAfterTable.SelectedTabPage = this.xtraTabPage1;
this.PrintAfterTable.Size = new System.Drawing.Size(819, 240);
this.PrintAfterTable.TabIndex = 10;
this.PrintAfterTable.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
this.xtraTabPage1,
this.xtraTabPage2});
//
// xtraTabPage1
//
this.xtraTabPage1.AutoScroll = true;
this.xtraTabPage1.Controls.Add(this.panel1);
this.xtraTabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(813, 211);
this.xtraTabPage1.Text = "待打印";
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.PrintTable);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(813, 211);
this.panel1.TabIndex = 0;
//
// PrintTable
//
this.PrintTable.Dock = System.Windows.Forms.DockStyle.Fill;
this.PrintTable.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.PrintTable.Location = new System.Drawing.Point(0, 0);
this.PrintTable.MainView = this.gridView1;
this.PrintTable.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.PrintTable.Name = "PrintTable";
this.PrintTable.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.repositoryItemTimeEdit1,
this.repositoryItemTextEdit1});
this.PrintTable.Size = new System.Drawing.Size(813, 211);
this.PrintTable.TabIndex = 0;
this.PrintTable.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridView1});
//
// gridView1
//
this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.id,
this.modid,
this.PrintCount,
this.libaryName,
this.printKeyvalue,
this.printModuleName,
this.printerName,
this.printSQL,
this.printSQL1,
this.printSQL2,
this.printSQL3,
this.printFlag,
this.printTime,
this.createTime});
this.gridView1.GridControl = this.PrintTable;
this.gridView1.Name = "gridView1";
this.gridView1.OptionsBehavior.Editable = false;
this.gridView1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;
//
// id
//
this.id.Caption = "打印id";
this.id.FieldName = "id";
this.id.Name = "id";
this.id.Visible = true;
this.id.VisibleIndex = 0;
//
// modid
//
this.modid.Caption = "模板编号ID";
this.modid.FieldName = "modid";
this.modid.Name = "modid";
this.modid.Visible = true;
this.modid.VisibleIndex = 1;
//
// PrintCount
//
this.PrintCount.Caption = "打印次数";
this.PrintCount.FieldName = "PrintCount";
this.PrintCount.Name = "PrintCount";
this.PrintCount.Visible = true;
this.PrintCount.VisibleIndex = 2;
//
// libaryName
//
this.libaryName.Caption = "调用程序";
this.libaryName.FieldName = "libaryName";
this.libaryName.Name = "libaryName";
this.libaryName.Visible = true;
this.libaryName.VisibleIndex = 3;
//
// printKeyvalue
//
this.printKeyvalue.Caption = "打印关键字";
this.printKeyvalue.FieldName = "printKeyvalue";
this.printKeyvalue.Name = "printKeyvalue";
this.printKeyvalue.Visible = true;
this.printKeyvalue.VisibleIndex = 4;
//
// printModuleName
//
this.printModuleName.Caption = "打印模板文件名";
this.printModuleName.FieldName = "printModuleName";
this.printModuleName.Name = "printModuleName";
this.printModuleName.Visible = true;
this.printModuleName.VisibleIndex = 5;
//
// printerName
//
this.printerName.Caption = "打印机名";
this.printerName.FieldName = "printerName";
this.printerName.Name = "printerName";
this.printerName.Visible = true;
this.printerName.VisibleIndex = 6;
//
// printSQL
//
this.printSQL.Caption = "打印主SQL";
this.printSQL.FieldName = "printSQL";
this.printSQL.Name = "printSQL";
this.printSQL.Visible = true;
this.printSQL.VisibleIndex = 7;
//
// printSQL1
//
this.printSQL1.Caption = "打印SQL1";
this.printSQL1.FieldName = "printSQL1";
this.printSQL1.Name = "printSQL1";
this.printSQL1.Visible = true;
this.printSQL1.VisibleIndex = 8;
//
// printSQL2
//
this.printSQL2.Caption = "打印明细sql";
this.printSQL2.FieldName = "printSQL2";
this.printSQL2.Name = "printSQL2";
this.printSQL2.Visible = true;
this.printSQL2.VisibleIndex = 9;
//
// printSQL3
//
this.printSQL3.Caption = "打印SQL3";
this.printSQL3.FieldName = "printSQL3";
this.printSQL3.Name = "printSQL3";
this.printSQL3.Visible = true;
this.printSQL3.VisibleIndex = 10;
//
// printFlag
//
this.printFlag.Caption = "是否已打印";
this.printFlag.FieldName = "printFlag";
this.printFlag.Name = "printFlag";
this.printFlag.Visible = true;
this.printFlag.VisibleIndex = 11;
//
// printTime
//
this.printTime.Caption = "打印时间";
this.printTime.ColumnEdit = this.repositoryItemTextEdit1;
this.printTime.FieldName = "printTime";
this.printTime.Name = "printTime";
this.printTime.Visible = true;
this.printTime.VisibleIndex = 12;
//
// repositoryItemTextEdit1
//
this.repositoryItemTextEdit1.AutoHeight = false;
this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
//
// createTime
//
this.createTime.Caption = "创建时间";
this.createTime.FieldName = "createTime";
this.createTime.Name = "createTime";
this.createTime.Visible = true;
this.createTime.VisibleIndex = 13;
//
// repositoryItemTimeEdit1
//
this.repositoryItemTimeEdit1.AutoHeight = false;
this.repositoryItemTimeEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1";
//
// xtraTabPage2
//
this.xtraTabPage2.AutoScroll = true;
this.xtraTabPage2.Controls.Add(this.panel2);
this.xtraTabPage2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(813, 211);
this.xtraTabPage2.Text = "已打印";
//
// panel2
//
this.panel2.AutoScroll = true;
this.panel2.Controls.Add(this.Afterprint);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(813, 211);
this.panel2.TabIndex = 0;
//
// Afterprint
//
this.Afterprint.ContextMenuStrip = this.contextMenuStrip1;
this.Afterprint.Dock = System.Windows.Forms.DockStyle.Fill;
this.Afterprint.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Afterprint.Location = new System.Drawing.Point(0, 0);
this.Afterprint.MainView = this.gridView2;
this.Afterprint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Afterprint.Name = "Afterprint";
this.Afterprint.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.repositoryItemTimeEdit2,
this.repositoryItemTextEdit2});
this.Afterprint.Size = new System.Drawing.Size(813, 211);
this.Afterprint.TabIndex = 1;
this.Afterprint.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gridView2});
//
// contextMenuStrip1
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(125, 48);
//
// 打印查看ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "打印查看ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.ToolStripMenuItem.Text = "打印查看";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 打印回撤ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "打印回撤ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.ToolStripMenuItem.Text = "打印回撤";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// gridView2
//
this.gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn1,
this.gridColumn2,
this.gridColumn14,
this.gridColumn3,
this.gridColumn4,
this.gridColumn5,
this.gridColumn6,
this.gridColumn7,
this.gridColumn8,
this.gridColumn9,
this.gridColumn10,
this.gridColumn11,
this.gridColumn12,
this.gridColumn13});
this.gridView2.GridControl = this.Afterprint;
this.gridView2.Name = "gridView2";
this.gridView2.OptionsBehavior.Editable = false;
this.gridView2.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;
//
// gridColumn1
//
this.gridColumn1.Caption = "打印id";
this.gridColumn1.FieldName = "id";
this.gridColumn1.Name = "gridColumn1";
this.gridColumn1.Visible = true;
this.gridColumn1.VisibleIndex = 0;
//
// gridColumn2
//
this.gridColumn2.Caption = "模板编号ID";
this.gridColumn2.FieldName = "modid";
this.gridColumn2.Name = "gridColumn2";
this.gridColumn2.Visible = true;
this.gridColumn2.VisibleIndex = 1;
//
// gridColumn14
//
this.gridColumn14.Caption = "打印次数";
this.gridColumn14.FieldName = "PrintCount";
this.gridColumn14.Name = "gridColumn14";
this.gridColumn14.Visible = true;
this.gridColumn14.VisibleIndex = 2;
//
// gridColumn3
//
this.gridColumn3.Caption = "调用程序";
this.gridColumn3.FieldName = "libaryName";
this.gridColumn3.Name = "gridColumn3";
this.gridColumn3.Visible = true;
this.gridColumn3.VisibleIndex = 3;
//
// gridColumn4
//
this.gridColumn4.Caption = "打印关键字";
this.gridColumn4.FieldName = "printKeyvalue";
this.gridColumn4.Name = "gridColumn4";
this.gridColumn4.Visible = true;
this.gridColumn4.VisibleIndex = 4;
//
// gridColumn5
//
this.gridColumn5.Caption = "打印模板文件名";
this.gridColumn5.FieldName = "printModuleName";
this.gridColumn5.Name = "gridColumn5";
this.gridColumn5.Visible = true;
this.gridColumn5.VisibleIndex = 5;
//
// gridColumn6
//
this.gridColumn6.Caption = "打印机名";
this.gridColumn6.FieldName = "printerName";
this.gridColumn6.Name = "gridColumn6";
this.gridColumn6.Visible = true;
this.gridColumn6.VisibleIndex = 6;
//
// gridColumn7
//
this.gridColumn7.Caption = "打印主SQL";
this.gridColumn7.FieldName = "printSQL";
this.gridColumn7.Name = "gridColumn7";
this.gridColumn7.Visible = true;
this.gridColumn7.VisibleIndex = 7;
//
// gridColumn8
//
this.gridColumn8.Caption = "打印SQL1";
this.gridColumn8.FieldName = "printSQL1";
this.gridColumn8.Name = "gridColumn8";
this.gridColumn8.Visible = true;
this.gridColumn8.VisibleIndex = 8;
//
// gridColumn9
//
this.gridColumn9.Caption = "打印明细sql";
this.gridColumn9.FieldName = "printSQL2";
this.gridColumn9.Name = "gridColumn9";
this.gridColumn9.Visible = true;
this.gridColumn9.VisibleIndex = 9;
//
// gridColumn10
//
this.gridColumn10.Caption = "打印SQL3";
this.gridColumn10.FieldName = "printSQL3";
this.gridColumn10.Name = "gridColumn10";
this.gridColumn10.Visible = true;
this.gridColumn10.VisibleIndex = 10;
//
// gridColumn11
//
this.gridColumn11.Caption = "是否已打印";
this.gridColumn11.FieldName = "printFlag";
this.gridColumn11.Name = "gridColumn11";
this.gridColumn11.Visible = true;
this.gridColumn11.VisibleIndex = 11;
//
// gridColumn12
//
this.gridColumn12.Caption = "打印时间";
this.gridColumn12.ColumnEdit = this.repositoryItemTextEdit2;
this.gridColumn12.FieldName = "printTime";
this.gridColumn12.Name = "gridColumn12";
this.gridColumn12.Visible = true;
this.gridColumn12.VisibleIndex = 12;
//
// repositoryItemTextEdit2
//
this.repositoryItemTextEdit2.AutoHeight = false;
this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
//
// gridColumn13
//
this.gridColumn13.Caption = "创建时间";
this.gridColumn13.FieldName = "createTime";
this.gridColumn13.Name = "gridColumn13";
this.gridColumn13.Visible = true;
this.gridColumn13.VisibleIndex = 13;
//
// repositoryItemTimeEdit2
//
this.repositoryItemTimeEdit2.AutoHeight = false;
this.repositoryItemTimeEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.repositoryItemTimeEdit2.Name = "repositoryItemTimeEdit2";
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// panelControl1
//
this.panelControl1.Controls.Add(this.lab_Sql);
this.panelControl1.Controls.Add(this.labelControl1);
this.panelControl1.Controls.Add(this.txt_timer);
this.panelControl1.Controls.Add(this.simpleButton1);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl1.Location = new System.Drawing.Point(0, 459);
this.panelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(819, 47);
this.panelControl1.TabIndex = 12;
//
// lab_Sql
//
this.lab_Sql.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lab_Sql.BackColor = System.Drawing.Color.Transparent;
this.lab_Sql.EditText = "";
this.lab_Sql.FontSize = 0F;
this.lab_Sql.LabelText = "sql设置";
this.lab_Sql.Location = new System.Drawing.Point(588, 16);
this.lab_Sql.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.lab_Sql.Model = null;
this.lab_Sql.Name = "lab_Sql";
this.lab_Sql.NullText = "";
this.lab_Sql.ReadOnly = false;
this.lab_Sql.Required = false;
this.lab_Sql.Size = new System.Drawing.Size(215, 19);
this.lab_Sql.TabIndex = 5;
//
// labelControl1
//
this.labelControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.labelControl1.Location = new System.Drawing.Point(440, 18);
this.labelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(24, 14);
this.labelControl1.TabIndex = 2;
this.labelControl1.Text = "时间";
//
// txt_timer
//
this.txt_timer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.txt_timer.Location = new System.Drawing.Point(472, 16);
this.txt_timer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txt_timer.Name = "txt_timer";
this.txt_timer.Size = new System.Drawing.Size(122, 20);
this.txt_timer.TabIndex = 1;
//
// simpleButton1
//
this.simpleButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.simpleButton1.Location = new System.Drawing.Point(317, 12);
this.simpleButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(118, 25);
this.simpleButton1.TabIndex = 0;
this.simpleButton1.Text = "设置打印";
this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click);
//
// txtLog
//
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtLog.Location = new System.Drawing.Point(0, 240);
this.txtLog.Multiline = true;
this.txtLog.Name = "txtLog";
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtLog.Size = new System.Drawing.Size(819, 219);
this.txtLog.TabIndex = 13;
//
// timer2
//
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//
// notifyIcon1
//
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "朗速自动打印监视";
this.notifyIcon1.Visible = true;
this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(819, 506);
this.Controls.Add(this.txtLog);
this.Controls.Add(this.panelControl1);
this.Controls.Add(this.PrintAfterTable);
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.Name = "Form1";
this.Text = "Form1";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.F_Main_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.SizeChanged += new System.EventHandler(this.F_Main_SizeChanged);
((System.ComponentModel.ISupportInitialize)(this.PrintAfterTable)).EndInit();
this.PrintAfterTable.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.PrintTable)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit1)).EndInit();
this.xtraTabPage2.ResumeLayout(false);
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.Afterprint)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridView2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.txt_timer.Properties)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraTab.XtraTabControl PrintAfterTable;
private DevExpress.XtraTab.XtraTabPage xtraTabPage1;
private DevExpress.XtraTab.XtraTabPage xtraTabPage2;
private System.Windows.Forms.Timer timer1;
private DevExpress.XtraEditors.PanelControl panelControl1;
private DevExpress.XtraEditors.TextEdit txt_timer;
private DevExpress.XtraEditors.SimpleButton simpleButton1;
private System.Windows.Forms.TextBox txtLog;
private DevExpress.XtraGrid.GridControl PrintTable;
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
private System.Windows.Forms.Timer timer2;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private Control.LabelMemoEdit lab_Sql;
private DevExpress.XtraEditors.LabelControl labelControl1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private DevExpress.XtraGrid.Columns.GridColumn id;
private DevExpress.XtraGrid.Columns.GridColumn modid;
private DevExpress.XtraGrid.Columns.GridColumn libaryName;
private DevExpress.XtraGrid.Columns.GridColumn printKeyvalue;
private DevExpress.XtraGrid.Columns.GridColumn printModuleName;
private DevExpress.XtraGrid.Columns.GridColumn printerName;
private DevExpress.XtraGrid.Columns.GridColumn printSQL;
private DevExpress.XtraGrid.Columns.GridColumn printSQL1;
private DevExpress.XtraGrid.Columns.GridColumn printSQL2;
private DevExpress.XtraGrid.Columns.GridColumn printSQL3;
private DevExpress.XtraGrid.Columns.GridColumn printFlag;
private DevExpress.XtraGrid.Columns.GridColumn printTime;
private DevExpress.XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit1;
private DevExpress.XtraGrid.Columns.GridColumn createTime;
private DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit repositoryItemTimeEdit1;
private DevExpress.XtraGrid.GridControl Afterprint;
private DevExpress.XtraGrid.Views.Grid.GridView gridView2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn4;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn5;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn6;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn7;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn8;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn9;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn10;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn11;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn12;
private DevExpress.XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit2;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn13;
private DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit repositoryItemTimeEdit2;
private DevExpress.XtraGrid.Columns.GridColumn PrintCount;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn14;
}
}
+537
View File
@@ -0,0 +1,537 @@
using Lskj.Business;
using Lskj.Business.Impl;
using Lskj.Control;
using Lskj.Control.Model;
using Lskj.Core;
using Lskj.Data;
using Lskj.Model;
using Lskj.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Lskj.PubPrint
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
public Form1()
{
if (DBConfig.Instance.CreateConnection())
{
InitializeComponent();
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection())) == 0)
{
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
return;
}
}
}
private object _objLock = new object();
/// <summary>
/// 日志队列
/// </summary>
private Queue<DataRow> _logQueue = new Queue<DataRow>();
/// <summary>
/// 日志队列锁
/// </summary>
private object _queueLock = new object();
/// <summary>
/// 用于判断是否加载完成就刷新
/// </summary>
int Count = 0;
/// <summary>
/// 用于判断是否加载完成就刷新
/// </summary>
bool flog = false;
/// <summary>
/// 设置刷新时间
/// </summary>
private string Timer;
/// <summary>
/// 设置sql表格数据
/// </summary>
private string Sql;
/// <summary>
/// 创建ini文件
/// </summary>
IniFiles ini = new IniFiles(Application.StartupPath + @"\MyConfig.INI");
/// <summary>
/// 临时表
/// </summary>
DataTable copydt = new DataTable();
/// <summary>
/// 查询条件
/// </summary>
public string condition;
/// <summary>
/// 多打印机筛选
/// </summary>
public string PrintScreen = string.Empty;
/// <summary>
/// 打印机列表
/// </summary>
List<string> PrinList = new List<string>();
/// <summary>
/// 查询条件
/// </summary>
public string SortField = string.Empty;
/// <summary>
/// 初始化程序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_Load(object sender, EventArgs e)
{
try
{
Initialization();
InitialGridFormat();
//// 创建后台线程
//Thread backThread = new Thread(ObtainPrint);
//backThread.IsBackground = true;
//backThread.Start();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
finally
{
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
}
}
/// <summary>
/// 打印成功判断
/// </summary>
public int PrintFlag;
/// <summary>
/// 设置表格名称
/// </summary>
private void InitialGridFormat()
{
this.gridView1.OptionsView.ColumnAutoWidth = false;
this.gridView2.OptionsView.ColumnAutoWidth = false;
Afterprint.DataSource = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag = 1 {2} {3}", Sql, condition, PrintScreen, SortField));
}
/// <summary>
/// 获取需要打印表格
/// </summary>
public void ObtainPrint()
{
this.Invoke(new EventHandler(delegate
{
DataTable DT = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag = 0 {2} {3}", Sql, condition, PrintScreen, SortField));
copydt = DT.Copy();
flog = false;
this.timer1.Enabled = false;
Dictionary<DataRow, List<Task<DataTable>>> sqlSourceDic = new Dictionary<DataRow, List<Task<DataTable>>>();
foreach (DataRow item in DT.Rows)
{
string printSQL = ReplaceHelper.ReplaceRowParam(item, item["printSQL"] + "");
string dllName = item["libaryName"] + "";
List<Task<DataTable>> dataTableTasks = new List<Task<DataTable>>();
if (dllName.Equals("Lskj.FastReportDesign.dll", StringComparison.CurrentCultureIgnoreCase))//匹配frx调用打印
{
List<string> tmpSqls = printSQL.Split(';').ToList();
foreach (string sql in tmpSqls)
{
Task<DataTable> task = new Task<DataTable>(() =>
{
DataTable dataTable = new DataTable();
string index = tmpSqls.IndexOf(sql) + "";
if (!string.IsNullOrEmpty(sql))
{
dataTable = BaseImpl.GetDataTableResult(sql).Copy();
dataTable.TableName = "temp" + index;
}
return dataTable;
});
task.Start();
dataTableTasks.Add(task);
}
}
sqlSourceDic.Add(item, dataTableTasks);
}
foreach (DataRow item in DT.Rows)
{
PrintFlag = 0;
try
{
bool over = false;
string msg = "";
Thread t = new Thread(() =>
{
KeyValuePair<DataRow, List<Task<DataTable>>> keyValuePair = sqlSourceDic.Where(n => n.Key == item).FirstOrDefault();
StartPrint(keyValuePair, out msg);
over = true;
});
t.SetApartmentState(ApartmentState.STA);
t.Start();
t.Join();
while (!over)
{
Thread.Sleep(500);
}
if (PrintFlag == 1)
{
RefreshLogUIThread(msg + "\r\n" + DateTime.Now + "模块" + item["id"].ToString() + "打印失败!\r\n");
string sqlValue = string.Format("update p_SystemPrintTaskTab set printFlag = 1,printTime='{1}',msg='{2}' where id='{0}'", item["id"], DateTime.Now.ToString(), "打印机条件出错!");
SqlHelper.ExecuteNonQuery(sqlValue);
}
else
{
RefreshLogUIThread(DateTime.Now + "" + "模块" + item["id"] + "打印成功!" + "\r\n");
string sqlValue = string.Format("update p_SystemPrintTaskTab set printFlag = 1,printTime='{1}' where id='{0}'", item["id"], DateTime.Now.ToString());
SqlHelper.ExecuteNonQuery(sqlValue);
}
if (copydt.Rows.Count > 0)
{
copydt.Rows.RemoveAt(0);
}
Afterprint.DataSource = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag=1 {2} {3}", Sql, condition, PrintScreen, SortField));
this.PrintTable.DataSource = copydt;
}
catch (Exception ex)
{
RefreshLog(DateTime.Now + "打印失败.\r\n" + ex);
}
}
}));
}
/// <summary>
/// 开始打印
/// </summary>
public void StartPrint(KeyValuePair<DataRow, List<Task<DataTable>>> keyValuePair, out string msg)
{
DataRow item = keyValuePair.Key;
List<Task<DataTable>> dataTableTasks = keyValuePair.Value;
//DataTable dt=SqlHelper.ExecuteDataTable(string.Format("select PrintAddress from p_systemComputerTab where PrintName='{0}'", item["printerName"]));
//String PrintAddress=dt.Rows.Count>0?dt.Rows[0]["PrintAddress"]+"":string.Empty;
//if (!PrinList.Contains(PrintAddress)) {
// PrintFlag = 1;
// return;
//}
try
{
msg = "";
string printSQL = ReplaceHelper.ReplaceRowParam(item, item["printSQL"] + "");
int num = int.Parse(item["PrintCount"] + "");
string dllName = item["libaryName"] + "";
string printerName = item["printerName"] + "";
if (dllName.Equals("Lskj.FastReportDesign.dll", StringComparison.CurrentCultureIgnoreCase))//匹配frx调用打印
{
List<string> tmpSqls = printSQL.Split(';').ToList();
PrintUtil.FastReportPrint(tmpSqls, item["printModuleName"] + "", true, printerName, dataTableTasks);
}
else
{
if (num > 1)
{
DelphiHelper.LoadDelphiDll(PubUtil.AbsolutelyPath + "Lib\\" + item["libaryName"], item["libaryName"] + "", item["printModuleName"] + "", item["printSQL"] + "", printSQL, Convert.ToInt32(3), item["printSQL"] + "");
item["PrintCount"] = num - 1;
StartPrint(keyValuePair, out msg);
}
else
{
DelphiHelper.LoadDelphiDll(PubUtil.AbsolutelyPath + "Lib\\" + item["libaryName"], item["libaryName"] + "", item["printModuleName"] + "", item["printSQL"] + "", printSQL, Convert.ToInt32(3), item["printSQL"] + "");
}
}
}
catch (Exception ex)
{
msg = ex.Message;
PrintFlag = 1;
}
}
public void Initialization()
{
try
{
RefreshLog(DateTime.Now + "正在初始化平台.\r\n");
//判断当前程序是否已经有在允许的,有就关闭当前程序
Process[] processes = Process.GetProcessesByName("Lskj.PubPrint");
if (processes.Length > 1)
{
//MessageUtil.Show("已有打开的当前程序");
System.Environment.Exit(0);
}
if (DBConfig.Instance.CreateConnection())
{
string ip = string.Empty;
//得到本机名
//ERPInfo.Instance.WindowName "SERVER-T"
string hostname = ERPInfo.Instance.WindowName;
//解析主机名称或IP地址的system.net.iphostentry实例。
//IPHostEntry localhost = Dns.GetHostEntry(hostname);
ip = ERPInfo.Instance.LoginIP;
//hostname = "PC-20210908GGIV";
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemComputerTab where ComputerName='{0}'", hostname));
//foreach (string ss in PrinterSettings.InstalledPrinters)
//{
// ///在列表框中列出所有的打印机,
// PrinList.Add(ss);
//}
if (dt.Rows.Count == 0)
{
MessageUtil.Show("未配置权限,请联系朗速工作人员!");
// 关闭所有的线程
System.Environment.Exit(0);
}
RefreshLog(DateTime.Now + "初始化平台成功.\r\n");
string print = dt.Rows[0]["PrintName"].ToString();
PrintScreen = print != null ? string.Format("and printerName='{0}'", print) : null;
if (dt.Columns.Contains("SortField"))
{
SortField = dt.Rows[0]["SortField"].ToString();
}
//获取ini配置的值
string time = ini.IniReadValue("刷新时间", "Timer");
Timer = string.IsNullOrWhiteSpace(time) ? "1000" : time;
string sql = ini.IniReadValue("刷新时间", "Sql");
Sql = !string.IsNullOrWhiteSpace(sql) ? ini.IniReadValue("刷新时间", "Sql") : "select * from p_SystemPrintTaskTab with(nolock)";
condition = Sql.Contains("where") ? "and" : "where";
string sqlValue = string.Format("update p_systemComputerTab set ipAddress ='{0}' where ComputerName='{1}'", ip, hostname);
SqlHelper.ExecuteNonQuery(sqlValue);
this.timer1.Start();
this.timer1.Interval = int.Parse(Timer) * 1000;
this.timer2.Interval = 100;
this.timer2.Start();
if (ini.ExistINIFile())
{
txt_timer.Text = ini.IniReadValue("刷新时间", "Timer");
lab_Sql.EditText = ini.IniReadValue("刷新时间", "Sql");
}
}
else
{
RefreshLog(DateTime.Now + " 初始化平台失败.\r\n");
}
}
catch (Exception ex)
{
RefreshLog(DateTime.Now + string.Format("初始化失败.原因:{0}.\r\n", ex.Message));
}
}
#region 线
/// <summary>
/// 主线程刷新数据
/// </summary>
/// <param name="msg"></param>
public void RefreshLog(string msg)
{
txtLog.Text += msg;
txtLog.Select(txtLog.TextLength, 0);
txtLog.ScrollToCaret();
}
/// <summary>
/// 后台线程刷新数据
/// </summary>
/// <param name="msg"></param>
public void RefreshLogUIThread(string msg)
{
Invoke((EventHandler)delegate
{
txtLog.Text += msg;
txtLog.Select(txtLog.TextLength, 0);
txtLog.ScrollToCaret();
});
}
private void FileViewer(string fileName)
{
try
{
System.Diagnostics.Process.Start(fileName);
}
catch { }
}
#endregion
private void timer1_Tick(object sender, EventArgs e)
{
try
{
ObtainPrint();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
private void timer2_Tick(object sender, EventArgs e)
{
try
{
if (copydt != null)
{
if (copydt.Rows.Count == 0)
{
this.timer1.Enabled = true;
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 更改刷新时间
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void simpleButton1_Click(object sender, EventArgs e)
{
try
{
//将ini文件清空
ini.IniWriteValue(null, null, null);
ini.IniWriteValue("刷新时间", "Timer", txt_timer.Text);
ini.IniWriteValue("刷新时间", "Sql", lab_Sql.EditText);
Initialization();
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 添加双击托盘图标事件(双击显示窗口)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
try
{
if (WindowState == FormWindowState.Minimized)
{
//还原窗体显示
WindowState = FormWindowState.Normal;
//激活窗体并给予它焦点
this.Activate();
//任务栏区显示图标
this.ShowInTaskbar = true;
//托盘区图标隐藏
notifyIcon1.Visible = false;
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 判断是否最小化,然后显示托盘
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void F_Main_SizeChanged(object sender, EventArgs e)
{
try
{
//判断是否选择的是最小化按钮
if (WindowState == FormWindowState.Minimized)
{
//隐藏任务栏区图标
this.ShowInTaskbar = false;
//图标显示在托盘区
notifyIcon1.Visible = true;
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 确认是否退出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void F_Main_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{
// 关闭所有的线程
this.Dispose();
this.Close();
}
else
{
e.Cancel = true;
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
DataRow item = this.gridView2.GetFocusedDataRow();
string printSQL = ReplaceHelper.ReplaceRowParam(item, item["printSQL2"] + "");
DelphiHelper.LoadDelphiDll(PubUtil.AbsolutelyPath + "Lib\\" + item["libaryName"], item["libaryName"] + "", item["printModuleName"] + "", item["printSQL"] + "", printSQL, Convert.ToInt32(4), item["printSQL"] + "");
RefreshLogUIThread(DateTime.Now + " 正在查看打印格式.\r\n");
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
DataRow item = this.gridView2.GetFocusedDataRow();
string sqlValue = string.Format("update p_SystemPrintTaskTab set printFlag = 0 where id='{0}'", item["id"]);
SqlHelper.ExecuteNonQuery(sqlValue);
DataTable DT = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag = 1 {2} {3}", Sql, condition, PrintScreen, SortField));
this.Afterprint.DataSource = DT;
RefreshLogUIThread(DateTime.Now + " 打印已回退.\r\n");
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
}
}
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace Lskj.PubPrint
{
public class IniFiles
{
public string inipath;
//声明API函数
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
/// <summary>
/// 构造方法
/// </summary>
/// <param name="INIPath">文件路径</param>
public IniFiles(string INIPath)
{
inipath = INIPath;
}
public IniFiles() { }
/// <summary>
/// 写入INI文件
/// </summary>
/// <param name="Section">项目名称(如 [TypeName] )</param>
/// <param name="Key">键</param>
/// <param name="Value">值</param>
public void IniWriteValue(string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, this.inipath);
}
/// <summary>
/// 读出INI文件
/// </summary>
/// <param name="Section">项目名称(如 [TypeName] )</param>
/// <param name="Key">键</param>
public string IniReadValue(string Section, string Key)
{
StringBuilder temp = new StringBuilder(500);
int i = GetPrivateProfileString(Section, Key, "", temp, 500, this.inipath);
return temp.ToString();
}
/// <summary>
/// 验证文件是否存在
/// </summary>
/// <returns>布尔值</returns>
public bool ExistINIFile()
{
return File.Exists(inipath);
}
}
}
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EAF1DD22-DDAE-4B9E-91F5-AB3E8950AFA5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lskj.PubPrint</RootNamespace>
<AssemblyName>Lskj.PubPrint</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>..\..\Debug\AllMethodXml\Lskj.PubPrint.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.BonusSkins.v15.2" />
<Reference Include="DevExpress.Data.v15.2" />
<Reference Include="DevExpress.Printing.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Utils.v15.2" />
<Reference Include="DevExpress.Sparkline.v15.2.Core" />
<Reference Include="DevExpress.XtraEditors.v15.2" />
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="FastReport, Version=2017.1.16.0, Culture=neutral, PublicKeyToken=417583d16d08abed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\FastReport.dll</HintPath>
</Reference>
<Reference Include="FastReport.Bars, Version=2017.1.16.0, Culture=neutral, PublicKeyToken=417583d16d08abed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\FastReport.Bars.dll</HintPath>
</Reference>
<Reference Include="FastReport.Editor, Version=2017.1.16.0, Culture=neutral, PublicKeyToken=417583d16d08abed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\FastReport.Editor.dll</HintPath>
</Reference>
<Reference Include="Geckofx-Core, Version=29.0.11.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\Geckofx-Core.dll</HintPath>
</Reference>
<Reference Include="Geckofx-Winforms, Version=29.0.11.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\Geckofx-Winforms.dll</HintPath>
</Reference>
<Reference Include="itextsharp, Version=5.5.8.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\itextsharp.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.0.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\NPOI.dll</HintPath>
</Reference>
<Reference Include="O2S.Components.PDFView4NET, Version=4.7.4.0, Culture=neutral, PublicKeyToken=bdf0cc7afcc23208, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\引用DLL\O2S.Components.PDFView4NET.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WinAPI.cs" />
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="IniFiles.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lskj.Business\Lskj.Business.csproj">
<Project>{7eafccc2-a18f-49e9-85c6-a984966cfd01}</Project>
<Name>Lskj.Business</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Control\Lskj.Control.csproj">
<Project>{447cdc40-659f-4cca-9ed6-8e818b4cf8bf}</Project>
<Name>Lskj.Control</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Core\Lskj.Core.csproj">
<Project>{2a1be6ac-1077-491b-a754-c5822fe8121e}</Project>
<Name>Lskj.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Data\Lskj.Data.csproj">
<Project>{308b9b18-9be2-495c-9c64-eed81d567813}</Project>
<Name>Lskj.Data</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Model\Lskj.Model.csproj">
<Project>{52bc40e0-c0c6-4f78-996b-cae028d209ca}</Project>
<Name>Lskj.Model</Name>
</ProjectReference>
<ProjectReference Include="..\Lskj.Util\Lskj.Util.csproj">
<Project>{a51bf642-6543-4de3-8948-83f558b72bd4}</Project>
<Name>Lskj.Util</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="logo.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+32
View File
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DevExpress.UserSkins;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
namespace Lskj.PubPrint
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
BonusSkins.Register();
SkinManager.EnableFormSkins();
UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");
AboutDevCompanion DC = new AboutDevCompanion(1, false);
DC.Run();
Application.Run(new Form1());
DC.Stop();
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Lskj.PubPrint")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lskj.PubPrint")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9006f149-aa49-4b8e-ba69-386d945fa738")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.PubPrint.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.PubPrint.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;
}
}
}
}
@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Lskj.PubPrint.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.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;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+403
View File
@@ -0,0 +1,403 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace Lskj.PubPrint
{
public static class WinAPI
{
#region
public const int GWL_WNDPROC = -4; //得到窗口回调函数的地址,或者句柄。得到后必须使用CallWindowProc函数来调用
public const int GWL_HINSTANCE = -6; //得到应用程序运行实例的句柄
public const int GWL_HWNDPARENT = -8; //得到父窗口的句柄
public const int GWL_STYLE = -16; //得到窗口风格
public const int GWL_EXSTYLE = -20; //得到扩展的窗口风格
public const int GWL_USERDATA = -21; //得到和窗口相关联的32位的值(每一个窗口都有一个有意留给创建窗口的应用程序是用的32位的值)
public const int GWL_ID = -12; //得到窗口的标识符
public const int DWL_MSGRESULT = 0;
public const int DWL_DLGPROC = 4;
public const int DWL_USER = 8;
public const int HWND_BOTTOM = 1;
public const int HWND_TOP = 0;
public const int HWND_TOPMOST = -1;
public const int HWND_NOTOPMOST = -2;
public const int SWP_DRAW = 0x20;
public const int SWP_HIDEWINDOW = 0x80;
public const int SWP_NOACTIVATE = 0x10;
public const int SWP_NOMOVE = 0x2;
public const int SWP_NOREDRAW = 0x8;
public const int SWP_NOSIZE = 0x1;
public const int SWP_NOZORDER = 0x4;
public const int SWP_SHOWWINDOW = 0x40;
public const int WS_OVERLAPPED = 0;
public const int WS_BORDER = 0x800000;
public const int WS_CAPTION = 0xC00000;
public const int WS_CHILD = 0x40000000;
public const int WS_DLGFRAME = 0x400000;
public const int WS_SIZEBOX = 0x40000;
public const int WS_MAXIMIZEBOX = 0x10000;
public const int WS_MINIMIZEBOX = 0x20000;
public const int WS_SYSMENU = 0x80000;
public const int WS_HSCROLL = 0x100000;
public const int WS_VSCROLL = 0x200000;
public const int WA_INACTIVE = 0;
public const int WA_ACTIVE = 1;
public const int WA_CLICKACTIVE = 2;
public const int WM_NOTIFY = 0x004E;
public const int WM_ACTIVATE = 0x0006;
public const int WM_NULL = 0x0000;
public const int WM_CREATE = 0x0001;
public const int WM_DESTROY = 0x0002;
public const int WM_MOVE = 0x0003;
public const int WM_SIZE = 0x0005;
public const int WM_SETFOCUS = 0x0007;
public const int WM_MOUSEACTIVATE = 0x0021;
public const int WM_CLOSE = 0x0010;
public const int WM_QUIT = 0x0012;
public const int WM_KEYDOWN = 0x0100;
public const int WM_KEYUP = 0x0101;
public const int WM_CHAR = 0x0102;
public const int WM_DEADCHAR = 0x0103;
public const int WM_SYSKEYDOWN = 0x0104;
public const int WM_SYSKEYUP = 0x0105;
public const int WM_SYSCHAR = 0x0106;
public const int WM_SYSDEADCHAR = 0x0107;
public const int WM_UNICHAR = 0x0109;
public const int WM_KEYLAST = 0x0109;
public const int UNICODE_NOCHAR = 0xFFFF;
public const int MK_LBUTTON = 0x0001;
public const int MK_RBUTTON = 0x0002;
public const int MK_SHIFT = 0x0004;
public const int MK_CONTROL = 0x0008;
public const int MK_MBUTTON = 0x0010;
public const int WM_MOUSEFIRST = 0x0200;
public const int WM_MOUSEMOVE = 0x0200;
public const int WM_LBUTTONDOWN = 0x0201;
public const int WM_LBUTTONUP = 0x0202;
public const int WM_LBUTTONDBLCLK = 0x0203;
public const int WM_RBUTTONDOWN = 0x0204;
public const int WM_RBUTTONUP = 0x0205;
public const int WM_RBUTTONDBLCLK = 0x0206;
public const int WM_MBUTTONDOWN = 0x0207;
public const int WM_MBUTTONUP = 0x0208;
public const int WM_MBUTTONDBLCLK = 0x0209;
public const int WM_MOUSEWHEEL = 0x020A;
public const int WM_MDICREATE = 0x0220;
public const int WM_ERASEBKGND = 0x14;
public const int WM_PAINT = 0xF;
public const int WM_NC_HITTEST = 0x84;
public const int WM_NC_PAINT = 0x85;
public const int WM_PRINTCLIENT = 0x318;
public const int WM_SETCURSOR = 0x20;
public const int BM_CLICK = 0x00F5;
public const int BM_GETIMAGE = 0x00F6;
public const int BM_SETIMAGE = 0x00F7;
public const int VK_BACK = 0x08;
public const int VK_TAB = 0x09;
public const int VK_CLEAR = 0x0C;
public const int VK_RETURN = 0x0D;
public const int VK_SHIFT = 0x10;
public const int VK_CONTROL = 0x11;
public const int VK_MENU = 0x12;
public const int VK_PAUSE = 0x13;
public const int VK_CAPITAL = 0x14;
public const int VK_KANA = 0x15;
public const int VK_HANGEUL = 0x15;
public const int VK_HANGUL = 0x15;
public const int VK_JUNJA = 0x17;
public const int VK_FINAL = 0x18;
public const int VK_HANJA = 0x19;
public const int VK_KANJI = 0x19;
public const int VK_ESCAPE = 0x1B;
public const int VK_CONVERT = 0x1C;
public const int VK_NONCONVERT = 0x1D;
public const int VK_ACCEPT = 0x1E;
public const int VK_MODECHANGE = 0x1F;
public const int VK_SPACE = 0x20;
public const int VK_PRIOR = 0x21;
public const int VK_NEXT = 0x22;
public const int VK_END = 0x23;
public const int VK_HOME = 0x24;
public const int VK_LEFT = 0x25;
public const int VK_UP = 0x26;
public const int VK_RIGHT = 0x27;
public const int VK_DOWN = 0x28;
public const int VK_SELECT = 0x29;
public const int VK_PRINT = 0x2A;
public const int VK_EXECUTE = 0x2B;
public const int VK_SNAPSHOT = 0x2C;
public const int VK_INSERT = 0x2D;
public const int VK_DELETE = 0x2E;
public const int VK_HELP = 0x2F;
public const int KEYEVENTF_EXTENDEDKEY = 0x0001;
public const int KEYEVENTF_KEYUP = 0x0002;
public const int KEYEVENTF_UNICODE = 0x0004;
public const int KEYEVENTF_SCANCODE = 0x0008;
public const int HC_ACTION = 0x0;
public const int WH_MOUSELL = 0xE;
public const int STATUS_SUCCESS = 0x0;
#endregion
#region API函数声明
[DllImport("user32.dll", EntryPoint = "SetParent")]
public static extern int SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll", EntryPoint = "GetParent")]
public static extern int GetParent(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
public static extern int GetWindowRect(IntPtr hwnd, out Rect lpRect);
[DllImport("user32.dll", EntryPoint = "SetWindowLong")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int lNewLong);
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int uFlags);
[DllImport("user32.dll", EntryPoint = "UpdateWindow")]
public static extern bool UpdateWindow(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", EntryPoint = "PostMessage")]
public static extern int PostMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "PostMessage")]
public static extern int PostMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", EntryPoint = "keybd_event")]
public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, long dwExtraInfo);
[DllImport("user32.dll", EntryPoint = "GetWindowThreadProcessId")]
public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int lpdwProcessId);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern void SetForegroundWindow(IntPtr hwnd);
[DllImport("user32.dll", EntryPoint = "DrawMenuBar")]
public static extern int DrawMenuBar(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "mouse_event")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, IntPtr dwExtraInfo);
[DllImport("user32.dll", EntryPoint = "SetCursorPos")]
public static extern void SetCursorPos(int x, int y);
[DllImport("user32.dll", EntryPoint = "GetCursorPos")]
public static extern bool GetCursorPos(out POINT p);
[DllImport("user32.dll", EntryPoint = "SetWindowsHookEx")]
public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
[DllImport("user32.dll", EntryPoint = "UnhookWindowsHookEx")]
public static extern int UnhookWindowsHookEx(int idHook);
[DllImport("user32.dll", EntryPoint = "CallNextHookEx")]
public static extern int CallNextHookEx(int idHook, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", EntryPoint = "GetWindowDC")]
public static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("user32.dll", EntryPoint = "ReleaseDC")]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
[DllImport("kernel32.dll")]
public static extern IntPtr GetModuleHandle(string name);
[DllImport("user32.dll")]
public static extern IntPtr WindowFromPoint(POINT Point);
[DllImport("user32.dll", EntryPoint = "GetDoubleClickTime")]
public static extern int GetDoubleClickTime();
[DllImport("user32.dll", EntryPoint = "FindWindow")]
public extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "FindWindow")]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
#endregion
/// <summary>
/// 表示 Hook 回调函数。
/// </summary>
/// <param name="nCode"></param>
/// <param name="wParam"></param>
/// <param name="lParam"></param>
/// <returns></returns>
public delegate int HookProc(int nCode, IntPtr wParam, IntPtr lParam);
/// <summary>
/// 表示进程间传递的数据结构
/// </summary>
public struct COPYDATASTRUCT
{
public IntPtr dwData;
public int cbData;
[MarshalAs(UnmanagedType.LPStr)]
public string lpData;
}
/// <summary>
/// 用于通过 API 获取位置信息的结构。
/// </summary>
public struct Rect
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
/// <summary>
/// 与非托管通信的鼠标位置结构。
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
}
/// <summary>
/// 鼠标事件标识。
/// </summary>
public enum MouseEventFlags
{
Move = 0x0001,
LeftDown = 0x0002,
LeftUp = 0x0004,
RightDown = 0x0008,
RightUp = 0x0010,
MiddleDown = 0x0020,
MiddleUp = 0x0040,
Wheel = 0x0800,
Absolute = 0x8000
}
}
public class FormatSystemDatetime
{
[DllImport("kernel32.dll", EntryPoint = "GetSystemDefaultLCID")]
public static extern int GetSystemDefaultLCID();
[DllImport("kernel32.dll", EntryPoint = "SetLocaleInfoA")]
public static extern int SetLocaleInfo(int Locale, int LCType, string lpLCData);
[DllImport("user32.dll", EntryPoint = "SendMessageTimeout")]
public static extern long SendMessageTimeout(int hWnd, int Msg, int wParam, int lParam, int fuFlags, int uTimeout, ref int lpdwResult);
public const int LOCALE_SSHORTDATE = 0x1F;
public const int LOCALE_SLONGDATE = 0x20;
public const int LOCALE_STIME = 0x1003;
public const int HWND_BROADCAST = 0xFFFF;
public const int WM_SETTINGCHANGE = 0x001A;
public const int SMTO_ABORTIFHUNG = 2;
public void SetDateTimeFormat()
{
try
{
int p = 0;
int x = GetSystemDefaultLCID();
SetLocaleInfo(x, LOCALE_SSHORTDATE, "yyyy-M-d"); //短日期格式
SetLocaleInfo(x, LOCALE_SLONGDATE, "yyyy年M月d日"); //长日期格式
SetLocaleInfo(x, LOCALE_STIME, "H:mm:ss"); //时间格式
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_ABORTIFHUNG, 10, ref p);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
/// <summary>
/// DevExpress
/// </summary>
public class AboutDevCompanion
{
private int Interval;
private bool ResidentMode;
private bool StopCompanion;
private Thread m_Thread;
/// <summary>
/// 按指定的模式创建 <see cref="Wunion.Budget.PowerBasicFramework.AboutDevCompanion"/> 对象实例。
/// <param name="interval">检测Dev注册弹框的时间间隔(以毫秒为单位)。</param>
/// <param name="resident">检测程序是否以常驻模式运行(默认值 true)。</param>
/// </summary>
public AboutDevCompanion(int interval, bool resident = true)
{
Interval = interval;
ResidentMode = resident;
StopCompanion = true;
}
/// <summary>
/// 关闭 DevExpress 控件的注册弹框(如果调用时找到并关闭了DevExpress注册弹框则返回true,否则返回false)。
/// </summary>
/// <returns></returns>
private bool CloseAboutDev()
{
IntPtr devHwnd = WinAPI.FindWindow(null, "About DevExpress");
if (devHwnd != IntPtr.Zero)
{
WinAPI.SendMessage(devHwnd, WinAPI.WM_CLOSE, 0, 0);
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;
}
}
}
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.11.0" newVersion="1.2.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.3.1" newVersion="2.1.3.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.XLS" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.3.8.0" newVersion="10.3.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.Presentation" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.3.6.0" newVersion="5.3.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Spire.Doc" publicKeyToken="663f351905198cb3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.3.15.0" newVersion="8.3.15.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB