📄 frmmain.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Xml;
using System.Threading;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace BxDataExport
{
/// <summary>
/// frmMain 的摘要说明。
/// </summary>
public class frmMain : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblKtUsingTime;
private System.Windows.Forms.Label lblKtStartTime;
private System.Windows.Forms.Label lblKtNowTime;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RichTextBox rtxtKt;
private System.Windows.Forms.Button button4;
private DbConnection sqlDb;
private System.Timers.Timer Nowtimer;
private System.Timers.Timer XhUsingtimer;
private System.Timers.Timer HwUsingtimer;
private System.Windows.Forms.Button button2;
private System.Timers.Timer timer1;
//private string sqlStrhw = "server=.;database=BxHwSbu;user id=sa;password=sa";
//private string sqlStrxh = "server=.;database=BxXhSbu;user id=sa;password=sa";
private string sqlStr = "server=192.168.57.239;database=SyXhSbu;user id=sa;password=1976";
//private string sqlStrxh = "server=192.168.57.239;database=BxXhSbu;user id=sa;password=1976";
private string oraStr = "Provider=OraOLEDB.Oracle.1;User ID=if_bac;Data Source=SYHWTSALE;password=if_bac";
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmMain());
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this.lblKtUsingTime = new System.Windows.Forms.Label();
this.lblKtStartTime = new System.Windows.Forms.Label();
this.lblKtNowTime = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.rtxtKt = new System.Windows.Forms.RichTextBox();
this.button4 = new System.Windows.Forms.Button();
this.XhUsingtimer = new System.Timers.Timer();
this.Nowtimer = new System.Timers.Timer();
this.HwUsingtimer = new System.Timers.Timer();
this.button2 = new System.Windows.Forms.Button();
this.timer1 = new System.Timers.Timer();
((System.ComponentModel.ISupportInitialize)(this.XhUsingtimer)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Nowtimer)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.HwUsingtimer)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
this.SuspendLayout();
//
// lblKtUsingTime
//
this.lblKtUsingTime.AutoSize = true;
this.lblKtUsingTime.ForeColor = System.Drawing.Color.Red;
this.lblKtUsingTime.Location = new System.Drawing.Point(592, 72);
this.lblKtUsingTime.Name = "lblKtUsingTime";
this.lblKtUsingTime.Size = new System.Drawing.Size(0, 17);
this.lblKtUsingTime.TabIndex = 18;
//
// lblKtStartTime
//
this.lblKtStartTime.AutoSize = true;
this.lblKtStartTime.ForeColor = System.Drawing.Color.Blue;
this.lblKtStartTime.Location = new System.Drawing.Point(112, 72);
this.lblKtStartTime.Name = "lblKtStartTime";
this.lblKtStartTime.Size = new System.Drawing.Size(0, 17);
this.lblKtStartTime.TabIndex = 17;
//
// lblKtNowTime
//
this.lblKtNowTime.AutoSize = true;
this.lblKtNowTime.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(192)), ((System.Byte)(192)));
this.lblKtNowTime.Location = new System.Drawing.Point(344, 72);
this.lblKtNowTime.Name = "lblKtNowTime";
this.lblKtNowTime.Size = new System.Drawing.Size(0, 17);
this.lblKtNowTime.TabIndex = 16;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(528, 72);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 17);
this.label4.TabIndex = 15;
this.label4.Text = "已用时间:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(280, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(66, 17);
this.label3.TabIndex = 14;
this.label3.Text = "现在时间:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(24, 72);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(91, 17);
this.label2.TabIndex = 13;
this.label2.Text = "开始导数时间:";
//
// button1
//
this.button1.Enabled = false;
this.button1.Location = new System.Drawing.Point(16, 32);
this.button1.Name = "button1";
this.button1.TabIndex = 12;
this.button1.Text = "开始导数";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(184, 17);
this.label1.TabIndex = 11;
this.label1.Text = "商用型号经理海外销售数据导数:";
//
// rtxtKt
//
this.rtxtKt.Location = new System.Drawing.Point(8, 96);
this.rtxtKt.Name = "rtxtKt";
this.rtxtKt.ReadOnly = true;
this.rtxtKt.Size = new System.Drawing.Size(904, 312);
this.rtxtKt.TabIndex = 10;
this.rtxtKt.Text = "";
//
// button4
//
this.button4.ForeColor = System.Drawing.Color.Red;
this.button4.Location = new System.Drawing.Point(760, 416);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(88, 23);
this.button4.TabIndex = 29;
this.button4.Text = "退 出";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// XhUsingtimer
//
this.XhUsingtimer.SynchronizingObject = this;
this.XhUsingtimer.Elapsed += new System.Timers.ElapsedEventHandler(this.XhUsingtimer_Elapsed);
//
// Nowtimer
//
this.Nowtimer.Enabled = true;
this.Nowtimer.SynchronizingObject = this;
this.Nowtimer.Elapsed += new System.Timers.ElapsedEventHandler(this.Nowtimer_Elapsed);
//
// HwUsingtimer
//
this.HwUsingtimer.SynchronizingObject = this;
//
// button2
//
this.button2.Location = new System.Drawing.Point(112, 32);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(104, 23);
this.button2.TabIndex = 41;
this.button2.Text = "清空监视框内容";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 3000;
this.timer1.SynchronizingObject = this;
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -