Commit ef527f7e authored by tr's avatar tr

1、增加SQL效率分析工具

parent 2f1a3a52
No preview for this file type
No preview for this file type
...@@ -6,4 +6,10 @@ ...@@ -6,4 +6,10 @@
<UserId>sa</UserId> <UserId>sa</UserId>
<Pwd>sa</Pwd> <Pwd>sa</Pwd>
</links> </links>
<links>
<Link>192.168.1.204</Link>
<DbName>FTT_PDM</DbName>
<UserId>sa</UserId>
<Pwd>sa</Pwd>
</links>
</DocumentElement> </DocumentElement>
\ No newline at end of file
...@@ -100,6 +100,16 @@ namespace Tools.Properties { ...@@ -100,6 +100,16 @@ namespace Tools.Properties {
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 分析 {
get {
object obj = ResourceManager.GetObject("分析", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary> /// </summary>
......
...@@ -130,6 +130,9 @@ ...@@ -130,6 +130,9 @@
<data name="使用说明" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="使用说明" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\使用说明.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\使用说明.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="分析" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\分析.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="实体类" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="实体类" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\实体类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\实体类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
......
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
<Compile Include="MyUtils\wMsgBox.Designer.cs"> <Compile Include="MyUtils\wMsgBox.Designer.cs">
<DependentUpon>wMsgBox.cs</DependentUpon> <DependentUpon>wMsgBox.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UI\wDbAnlysis.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\wDbAnlysis.Designer.cs">
<DependentUpon>wDbAnlysis.cs</DependentUpon>
</Compile>
<Compile Include="UI\wDBTools.cs"> <Compile Include="UI\wDBTools.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -120,6 +126,9 @@ ...@@ -120,6 +126,9 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<EmbeddedResource Include="UI\wDbAnlysis.resx">
<DependentUpon>wDbAnlysis.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\wDBTools.resx"> <EmbeddedResource Include="UI\wDBTools.resx">
<DependentUpon>wDBTools.cs</DependentUpon> <DependentUpon>wDBTools.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -186,5 +195,8 @@ ...@@ -186,5 +195,8 @@
<Name>UpdateExecuter</Name> <Name>UpdateExecuter</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\分析.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
namespace Tools.UI
{
partial class wDbAnlysis
{
/// <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()
{
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tsbAnlysis = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsbDbLink = new System.Windows.Forms.ToolStripButton();
this.tslbDbLinkString = new System.Windows.Forms.ToolStripLabel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tbScriptText = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.tbAnlysisResult = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.panel3 = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.panel2.SuspendLayout();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAnlysis,
this.toolStripSeparator1,
this.tsbDbLink,
this.tslbDbLinkString});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(824, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// tsbAnlysis
//
this.tsbAnlysis.Image = global::Tools.Properties.Resources.分析;
this.tsbAnlysis.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbAnlysis.Name = "tsbAnlysis";
this.tsbAnlysis.Size = new System.Drawing.Size(100, 22);
this.tsbAnlysis.Text = "查询效率分析";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// tsbDbLink
//
this.tsbDbLink.Image = global::Tools.Properties.Resources.数据库;
this.tsbDbLink.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDbLink.Name = "tsbDbLink";
this.tsbDbLink.Size = new System.Drawing.Size(64, 22);
this.tsbDbLink.Text = "数据库";
//
// tslbDbLinkString
//
this.tslbDbLinkString.Font = new System.Drawing.Font("Microsoft YaHei UI", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tslbDbLinkString.ForeColor = System.Drawing.Color.DarkRed;
this.tslbDbLinkString.Name = "tslbDbLinkString";
this.tslbDbLinkString.Size = new System.Drawing.Size(98, 22);
this.tslbDbLinkString.Text = "·····请先选择数据库·····";
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tbScriptText);
this.splitContainer1.Panel1.Controls.Add(this.panel1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(824, 526);
this.splitContainer1.SplitterDistance = 500;
this.splitContainer1.TabIndex = 1;
//
// tbScriptText
//
this.tbScriptText.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbScriptText.Location = new System.Drawing.Point(0, 29);
this.tbScriptText.Multiline = true;
this.tbScriptText.Name = "tbScriptText";
this.tbScriptText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbScriptText.Size = new System.Drawing.Size(500, 497);
this.tbScriptText.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(500, 29);
this.panel1.TabIndex = 2;
//
// label1
//
this.label1.Location = new System.Drawing.Point(11, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(188, 23);
this.label1.TabIndex = 1;
this.label1.Text = "此处输入SQL语句";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.tbAnlysisResult);
this.splitContainer2.Panel1.Controls.Add(this.panel2);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.textBox3);
this.splitContainer2.Panel2.Controls.Add(this.panel3);
this.splitContainer2.Size = new System.Drawing.Size(320, 526);
this.splitContainer2.SplitterDistance = 280;
this.splitContainer2.TabIndex = 0;
//
// tbAnlysisResult
//
this.tbAnlysisResult.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbAnlysisResult.Location = new System.Drawing.Point(0, 29);
this.tbAnlysisResult.Multiline = true;
this.tbAnlysisResult.Name = "tbAnlysisResult";
this.tbAnlysisResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbAnlysisResult.Size = new System.Drawing.Size(320, 251);
this.tbAnlysisResult.TabIndex = 0;
//
// panel2
//
this.panel2.Controls.Add(this.label2);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(320, 29);
this.panel2.TabIndex = 3;
//
// label2
//
this.label2.Location = new System.Drawing.Point(11, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(203, 23);
this.label2.TabIndex = 2;
this.label2.Text = "表或视图的COUNT(*)查询时间";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox3
//
this.textBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox3.Location = new System.Drawing.Point(0, 29);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox3.Size = new System.Drawing.Size(320, 213);
this.textBox3.TabIndex = 0;
//
// panel3
//
this.panel3.Controls.Add(this.label3);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 0);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(320, 29);
this.panel3.TabIndex = 3;
//
// label3
//
this.label3.Location = new System.Drawing.Point(12, 3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(209, 23);
this.label3.TabIndex = 2;
this.label3.Text = "此处为预留功能区,后续完善";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// wDbAnlysis
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(824, 551);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Name = "wDbAnlysis";
this.Text = "简易SQL效率分析";
this.Load += new System.EventHandler(this.wDbAnlysis_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton tsbAnlysis;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.TextBox tbScriptText;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbAnlysisResult;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton tsbDbLink;
private System.Windows.Forms.ToolStripLabel tslbDbLinkString;
}
}
\ No newline at end of file
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//
using Tools.MyData;
using Tools.MyUtils;
using System.Collections.Generic;
namespace Tools.UI
{
public partial class wDbAnlysis : MyCommon.wBasic
{
/// <summary>
/// 数据库访问对象
/// </summary>
SmpDB _db = new SmpDB();
/// <summary>
/// 数据库链接
/// </summary>
string _link = "";
public wDbAnlysis()
{
InitializeComponent();
}
private void wDbAnlysis_Load(object sender, EventArgs e)
{
//工具栏-事件
this.tsbAnlysis.Click += TsbAnlysis_Click;
this.tsbDbLink.Click += TsbDbLink_Click;
}
/// <summary>
/// 事件:查询效率分析
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TsbAnlysis_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this._link))
{
Utils.Tip("请先选择数据库!");
return;
}
Stopwatch stopwatch = new Stopwatch();
try
{
var text = this.tbScriptText.Text.Trim().ToLower();
var nameList = this.GetScriptTableNameList(text);
var result = new List<string>();
for (int i = 0; i < nameList.Count; i++)
{
var objName = nameList[i];
var anlysisSql = $@"
IF EXISTS(SELECT 1 FROM sys.objects WHERE name = '{objName}')
BEGIN
SELECT COUNT(*) FROM {objName}
END";
stopwatch.Restart();
this._db.ExecNonSql(this._link, new List<string> { anlysisSql });
stopwatch.Stop();
result.Add($"{stopwatch.ElapsedMilliseconds / 1000F}秒\t{objName}");
}
//显示结果
tbAnlysisResult.Text = string.Join("\r\n", result);
}
catch (Exception ex)
{
Utils.Tip("性能分析出错!" + ex.Message);
}
}
/// <summary>
/// 事件:数据库
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TsbDbLink_Click(object sender, EventArgs e)
{
var w = new wDbSetting();
if (w.ShowDialog() == DialogResult.OK)
{
this._link = w.LinkModel.LinkString;
this.tslbDbLinkString.Text = w.LinkModel.ToString();
}
}
/// <summary>
/// 获取SQL脚本中的表名称
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
private List<string> GetScriptTableNameList(string text)
{
var result = new List<string>();
//只按常用连接字符分段
var partList = text.Split(new string[] { "from", "left join", "inner join" }, StringSplitOptions.RemoveEmptyEntries).ToList();
partList.RemoveAt(0); //剔除第1个,第一个为select
foreach (var s in partList)
{
//先初略按照常见空白字符区分
var objName = s.Trim().Split(new char[] { ' ', '\t', '\r', '\n' })[0]; //第一个为表或视图名
//去重;临时表和带变量的不处理;忽略带括号的子查询或表值函数
if (result.IndexOf(objName) >= 0 || objName.Contains("@") || objName.Contains("#") || objName.Contains("(") || objName.Contains(")"))
continue;
result.Add(objName);
}
return result;
}
}
}
<?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>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
...@@ -20,6 +20,7 @@ namespace Tools ...@@ -20,6 +20,7 @@ namespace Tools
case "UpdateExecuter": result = new UpdateExecuter.frmMain(); break; case "UpdateExecuter": result = new UpdateExecuter.frmMain(); break;
case "PatchPack": result = new Ftt.PatchPack.FrmMain(); break; case "PatchPack": result = new Ftt.PatchPack.FrmMain(); break;
case "DbDevelopTool": result = new UI.wDBTools(); break; case "DbDevelopTool": result = new UI.wDBTools(); break;
case "DbAnlysis": result = new UI.wDbAnlysis(); break;
default: break; default: break;
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
this.btnPatchPack = new System.Windows.Forms.Button(); this.btnPatchPack = new System.Windows.Forms.Button();
this.btnDbDevelopTool = new System.Windows.Forms.Button(); this.btnDbDevelopTool = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.btnDbAnlysis = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnUpdateExecuter // btnUpdateExecuter
...@@ -68,12 +69,24 @@ ...@@ -68,12 +69,24 @@
this.btnDbDevelopTool.Text = "数据库开发工具"; this.btnDbDevelopTool.Text = "数据库开发工具";
this.btnDbDevelopTool.UseVisualStyleBackColor = false; this.btnDbDevelopTool.UseVisualStyleBackColor = false;
// //
// btnDbAnlysis
//
this.btnDbAnlysis.BackColor = System.Drawing.SystemColors.Control;
this.btnDbAnlysis.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnDbAnlysis.Location = new System.Drawing.Point(58, 142);
this.btnDbAnlysis.Name = "btnDbAnlysis";
this.btnDbAnlysis.Size = new System.Drawing.Size(135, 25);
this.btnDbAnlysis.TabIndex = 3;
this.btnDbAnlysis.Text = "简易SQL效率分析";
this.btnDbAnlysis.UseVisualStyleBackColor = false;
//
// wMain // wMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window; this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(257, 164); this.ClientSize = new System.Drawing.Size(257, 198);
this.Controls.Add(this.btnDbAnlysis);
this.Controls.Add(this.btnDbDevelopTool); this.Controls.Add(this.btnDbDevelopTool);
this.Controls.Add(this.btnPatchPack); this.Controls.Add(this.btnPatchPack);
this.Controls.Add(this.btnUpdateExecuter); this.Controls.Add(this.btnUpdateExecuter);
...@@ -90,5 +103,6 @@ ...@@ -90,5 +103,6 @@
private System.Windows.Forms.Button btnPatchPack; private System.Windows.Forms.Button btnPatchPack;
private System.Windows.Forms.Button btnDbDevelopTool; private System.Windows.Forms.Button btnDbDevelopTool;
private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Button btnDbAnlysis;
} }
} }
\ No newline at end of file
...@@ -28,6 +28,7 @@ namespace Tools ...@@ -28,6 +28,7 @@ namespace Tools
this.btnUpdateExecuter.Click += Button_Click; this.btnUpdateExecuter.Click += Button_Click;
this.btnPatchPack.Click += Button_Click; this.btnPatchPack.Click += Button_Click;
this.btnDbDevelopTool.Click += Button_Click; this.btnDbDevelopTool.Click += Button_Click;
this.btnDbAnlysis.Click += Button_Click;
} }
private void Button_Click(object sender, EventArgs e) private void Button_Click(object sender, EventArgs e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment