Winform美化MessageBox_weixin_30493321的博客-程序员秘密

技术标签: c#  runtime  

现在在做的项目美工要求比较高,所以根据网上搜索的资料,自定义了一整套的弹出框,供大家参考,之网上其他大神有调用系统ICO的,容易导致异常,我在此使用本地资源ICO,效率高不异常。


using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.Runtime.InteropServices; using YLYJ_Cashier.Common; namespace YLYJ_Cashier { public partial class MyMsgBox : SkinMain { [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern bool MessageBeep(uint type); [DllImport("User32.dll", EntryPoint = "SetWindowLong", SetLastError = true)] public static extern bool SetWindowLong(IntPtr hWnd, int nIndex, int nFlags); [DllImport("User32.dll", EntryPoint = "GetWindowLong", SetLastError = true)] public static extern int GetWindowLong(IntPtr hWnd, int nFlags); [DllImport("User32.dll", EntryPoint = "SetWindowPos", SetLastError = true)] public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndWinInsertAfter, int x, int y, int cx, int cy, int nFlags); const int WS_EX_TOOLWINDOW = 0x80; const int GWL_EXSTYLE = -20; const int HWND_TOPMOST = -1; const int SWP_NOSIZE = 0x0001; const int SWP_NOMOVE = 0x0002; static private MyMsgBox newMessageBox; static private Label frmTitle; static private Label frmMessage; static private PictureBox pIcon; static private FlowLayoutPanel flpButtons; static private Icon frmIcon; static private Button btnOK; static private Button btnAbort; static private Button btnRetry; static private Button btnIgnore; static private Button btnCancel; static private Button btnYes; static private Button btnNo; static private DialogResult CYReturnButton; public enum MyIcon { Information, Question, Warning } public enum MyButtons { AbortRetryIgnore, OK, OKCancel, RetryCancel, YesNo, YesNoCancel } static private void BuildMessageBox(string title) { try { newMessageBox = new MyMsgBox(); newMessageBox.Text = title; newMessageBox.Size = new System.Drawing.Size(350, 150); newMessageBox.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; newMessageBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; newMessageBox.Paint += new PaintEventHandler(newMessageBox_Paint); newMessageBox.BackColor = System.Drawing.Color.White; TableLayoutPanel tlp = new TableLayoutPanel(); tlp.RowCount = 3; tlp.ColumnCount = 0; tlp.Dock = System.Windows.Forms.DockStyle.Fill; tlp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22)); tlp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); tlp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50)); tlp.BackColor = System.Drawing.Color.Transparent; tlp.Padding = new Padding(2, 5, 2, 2); frmTitle = new Label(); frmTitle.Dock = System.Windows.Forms.DockStyle.Fill; frmTitle.BackColor = System.Drawing.Color.Transparent; frmTitle.ForeColor = System.Drawing.Color.White; frmTitle.Font = new Font("微软雅黑", 10, FontStyle.Bold); frmMessage = new Label(); frmMessage.Dock = System.Windows.Forms.DockStyle.Fill; frmMessage.BackColor = System.Drawing.Color.White; frmMessage.ForeColor=ColorTranslator.FromHtml("#333333"); frmMessage.Font = new Font("微软雅黑", 12, FontStyle.Regular); frmMessage.Padding = new Padding(0, 10, 0, 0); frmMessage.Text = "hiii"; pIcon = new PictureBox(); flpButtons = new FlowLayoutPanel(); flpButtons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; flpButtons.Padding = new Padding(0, 5, 5, 0); flpButtons.Dock = System.Windows.Forms.DockStyle.Fill; flpButtons.BackColor = System.Drawing.Color.White; TableLayoutPanel tlpMessagePanel = new TableLayoutPanel(); tlpMessagePanel.BackColor = System.Drawing.Color.White; tlpMessagePanel.ForeColor = ColorTranslator.FromHtml("#333333"); tlpMessagePanel.Dock = System.Windows.Forms.DockStyle.Fill; tlpMessagePanel.ColumnCount = 2; tlpMessagePanel.RowCount = 0; tlpMessagePanel.Padding = new Padding(4, 5, 4, 4); tlpMessagePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50)); tlpMessagePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); tlpMessagePanel.Controls.Add(pIcon); tlpMessagePanel.Controls.Add(frmMessage); tlp.Controls.Add(frmTitle); tlp.Controls.Add(tlpMessagePanel); tlp.Controls.Add(flpButtons); newMessageBox.Controls.Add(tlp); } catch (Exception ee) { Log.WriteLog("消息框弹出时发生异常:" + ee.Message.ToString()); } } /// <summary> /// 默认消息提示,图标为感叹号 /// </summary> static public DialogResult Show(string Message) { BuildMessageBox("提示"); frmTitle.Text = "提示"; frmMessage.Text = Message; ShowOKButton(); IconStatements(MyIcon.Information); Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38); pIcon.Image = imageIcon; newMessageBox.ShowDialog(); return CYReturnButton; } /// <summary> /// Message: Text to display in the message box. /// </summary> static public DialogResult Show(string Message, MyIcon MIcon) { BuildMessageBox("提示"); frmTitle.Text = "提示"; frmMessage.Text = Message; ShowOKButton(); IconStatements(MIcon); Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38); pIcon.Image = imageIcon; newMessageBox.ShowDialog(); return CYReturnButton; } /// <summary> /// Title: Text to display in the title bar of the messagebox. /// </summary> static public DialogResult Show(string Message, string Title) { BuildMessageBox(Title); frmTitle.Text = Title; frmMessage.Text = Message; ShowOKButton(); newMessageBox.ShowDialog(); return CYReturnButton; } /// <summary> /// MButtons: Display MyButtons on the message box. /// </summary> static public DialogResult Show(string Message, string Title, MyButtons MButtons) { BuildMessageBox(Title); // BuildMessageBox method, responsible for creating the MessageBox frmTitle.Text = Title; // Set the title of the MessageBox frmMessage.Text = Message; //Set the text of the MessageBox ButtonStatements(MButtons); // ButtonStatements method is responsible for showing the appropreiate buttons newMessageBox.ShowDialog(); // Show the MessageBox as a Dialog. return CYReturnButton; // Return the button click as an Enumerator } /// <summary> /// MIcon: Display MyIcon on the message box. /// </summary> static public DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon) { BuildMessageBox(Title); frmTitle.Text = Title; frmMessage.Text = Message; ButtonStatements(MButtons); IconStatements(MIcon); Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38); pIcon.Image = imageIcon; newMessageBox.ShowDialog(); return CYReturnButton; } static void btn_MouseEnter(object sender, EventArgs e) { var btn = (Button)sender; btn.BackgroundImage = Properties.Resources.buttonHover; } static void btn_MouseLeave(object sender, EventArgs e) { var btn = (Button)sender; btn.BackgroundImage = Properties.Resources.buttonBack; } static void btnOK_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.OK; newMessageBox.Dispose(); } static void btnAbort_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.Abort; newMessageBox.Dispose(); } static void btnRetry_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.Retry; newMessageBox.Dispose(); } static void btnIgnore_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.Ignore; newMessageBox.Dispose(); } static void btnCancel_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.Cancel; newMessageBox.Dispose(); } static void btnYes_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.Yes; newMessageBox.Dispose(); } static void btnNo_Click(object sender, EventArgs e) { CYReturnButton = DialogResult.No; newMessageBox.Dispose(); } static private void ShowOKButton() { btnOK = new Button(); btnOK.Text = "确认"; btnOK.Size = new System.Drawing.Size(80, 32); btnOK.BackColor = System.Drawing.Color.Transparent; ; btnOK.BackgroundImage = Properties.Resources.buttonBack; btnOK.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnOK.BackgroundImageLayout = ImageLayout.Stretch; btnOK.ForeColor = System.Drawing.Color.White; btnOK.TextAlign = ContentAlignment.TopCenter; btnOK.FlatAppearance.BorderSize = 0; btnOK.FlatStyle = FlatStyle.Flat; btnOK.Click += new EventHandler(btnOK_Click); btnOK.MouseEnter += new EventHandler(btn_MouseEnter); btnOK.MouseLeave += new EventHandler(btn_MouseLeave); btnOK.Cursor=Cursors.Hand; flpButtons.Controls.Add(btnOK); } static private void ShowAbortButton() { btnAbort = new Button(); btnAbort.Text = "停止"; btnAbort.Size = new System.Drawing.Size(80, 32); btnAbort.BackColor = System.Drawing.Color.Transparent; btnAbort.BackgroundImage = Properties.Resources.buttonBack; btnAbort.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnAbort.BackgroundImageLayout = ImageLayout.Stretch; btnAbort.ForeColor = System.Drawing.Color.White; btnAbort.TextAlign = ContentAlignment.TopCenter; btnAbort.FlatAppearance.BorderSize = 0; btnAbort.FlatStyle = FlatStyle.Flat; btnAbort.Click += new EventHandler(btnAbort_Click); btnAbort.MouseEnter += new EventHandler(btn_MouseEnter); btnAbort.MouseLeave += new EventHandler(btn_MouseLeave); btnAbort.Cursor = Cursors.Hand; flpButtons.Controls.Add(btnAbort); } static private void ShowRetryButton() { btnRetry = new Button(); btnRetry.Text = "重试"; btnRetry.Size = new System.Drawing.Size(80, 32); btnRetry.BackColor = System.Drawing.Color.Transparent; btnRetry.BackgroundImage = Properties.Resources.buttonBack; btnRetry.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnRetry.BackgroundImageLayout = ImageLayout.Stretch; btnRetry.ForeColor = System.Drawing.Color.White; btnRetry.TextAlign = ContentAlignment.TopCenter; btnRetry.FlatAppearance.BorderSize = 0; btnRetry.FlatStyle = FlatStyle.Flat; btnRetry.Click += new EventHandler(btnRetry_Click); btnRetry.MouseEnter += new EventHandler(btn_MouseEnter); btnRetry.MouseLeave += new EventHandler(btn_MouseLeave); btnRetry.Cursor = Cursors.Hand; flpButtons.Controls.Add(btnRetry); } static private void ShowIgnoreButton() { btnIgnore = new Button(); btnIgnore.Text = "忽略"; btnIgnore.Size = new System.Drawing.Size(80, 32); btnIgnore.BackColor = System.Drawing.Color.Transparent; btnIgnore.BackgroundImage = Properties.Resources.buttonBack; btnIgnore.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnIgnore.BackgroundImageLayout = ImageLayout.Stretch; btnIgnore.ForeColor = System.Drawing.Color.White; btnIgnore.TextAlign = ContentAlignment.TopCenter; btnIgnore.FlatAppearance.BorderSize = 0; btnIgnore.FlatStyle = FlatStyle.Flat; btnIgnore.Click += new EventHandler(btnIgnore_Click); btnIgnore.MouseEnter += new EventHandler(btn_MouseEnter); btnIgnore.MouseLeave += new EventHandler(btn_MouseLeave); btnIgnore.Cursor = Cursors.Hand; flpButtons.Controls.Add(btnIgnore); } static private void ShowCancelButton() { btnCancel = new Button(); btnCancel.Text = "取消"; btnCancel.Size = new System.Drawing.Size(80, 32); btnCancel.BackColor = System.Drawing.Color.Transparent; btnCancel.BackgroundImage = Properties.Resources.buttonBack; btnCancel.Font = new Font("微软雅黑",9, FontStyle.Regular); btnCancel.BackgroundImageLayout = ImageLayout.Stretch; btnCancel.ForeColor = System.Drawing.Color.White; btnCancel.TextAlign = ContentAlignment.TopCenter; btnCancel.FlatAppearance.BorderSize = 0; btnCancel.FlatStyle = FlatStyle.Flat; btnCancel.Click += new EventHandler(btnCancel_Click); btnCancel.MouseEnter += new EventHandler(btn_MouseEnter); btnCancel.MouseLeave += new EventHandler(btn_MouseLeave); btnCancel.Cursor = Cursors.Hand; flpButtons.Controls.Add(btnCancel); } static private void ShowYesButton() { btnYes = new Button(); btnYes.Text = "是"; btnYes.Size = new System.Drawing.Size(80, 32); btnYes.BackColor = System.Drawing.Color.Transparent; btnYes.BackgroundImage = Properties.Resources.buttonBack; btnYes.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnYes.BackgroundImageLayout = ImageLayout.Stretch; btnYes.ForeColor = System.Drawing.Color.White; btnYes.TextAlign = ContentAlignment.TopCenter; btnYes.FlatAppearance.BorderSize = 0; btnYes.FlatStyle = FlatStyle.Flat; btnYes.Click += new EventHandler(btnYes_Click); btnYes.MouseEnter += new EventHandler(btn_MouseEnter); btnYes.MouseLeave += new EventHandler(btn_MouseLeave); btnYes.Cursor = Cursors.Hand; btnYes.TabIndex = 1; flpButtons.Controls.Add(btnYes); } static private void ShowNoButton() { btnNo = new Button(); btnNo.Text = "否"; btnNo.Size = new System.Drawing.Size(80, 32); btnNo.BackColor = System.Drawing.Color.Transparent; btnNo.BackgroundImage = Properties.Resources.buttonBack; btnNo.Font = new Font("微软雅黑", 9, FontStyle.Regular); btnNo.BackgroundImageLayout = ImageLayout.Stretch; btnNo.ForeColor = System.Drawing.Color.White; btnNo.TextAlign = ContentAlignment.TopCenter; btnNo.FlatAppearance.BorderSize = 0; btnNo.FlatStyle = FlatStyle.Flat; btnNo.Click += new EventHandler(btnNo_Click); btnNo.MouseEnter += new EventHandler(btn_MouseEnter); btnNo.MouseLeave += new EventHandler(btn_MouseLeave); btnNo.Cursor = Cursors.Hand; flpButtons.Controls.Add(btnNo); } static private void ButtonStatements(MyButtons MButtons) { try { if (MButtons == MyButtons.AbortRetryIgnore) { ShowIgnoreButton(); ShowRetryButton(); ShowAbortButton(); } if (MButtons == MyButtons.OK) { ShowOKButton(); } if (MButtons == MyButtons.OKCancel) { ShowCancelButton(); ShowOKButton(); } if (MButtons == MyButtons.RetryCancel) { ShowCancelButton(); ShowRetryButton(); } if (MButtons == MyButtons.YesNo) { ShowNoButton(); ShowYesButton(); } if (MButtons == MyButtons.YesNoCancel) { ShowCancelButton(); ShowNoButton(); ShowYesButton(); } } catch (Exception ee) { Log.WriteLog("消息框弹出时发生异常:" + ee.Message.ToString()); } } static private void IconStatements(MyIcon MIcon) { try { if (MIcon == MyIcon.Information) { MessageBeep(0); frmIcon = Properties.Resources.information; } if (MIcon == MyIcon.Question) { MessageBeep(0); frmIcon = Properties.Resources.question; } if (MIcon == MyIcon.Warning) { MessageBeep(30); frmIcon = Properties.Resources.warning; } } catch (Exception ee) { Log.WriteLog("消息框弹出时发生异常:" + ee.Message.ToString()); } } static void newMessageBox_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle frmTitleL = new Rectangle(0, 0, (newMessageBox.Width / 2), 30); Rectangle frmTitleR = new Rectangle((newMessageBox.Width / 2), 0, (newMessageBox.Width / 2), 30); Rectangle frmMessageBox = new Rectangle(0, 0, (newMessageBox.Width - 1), (newMessageBox.Height - 1)); LinearGradientBrush frmLGBL = new LinearGradientBrush(frmTitleL, Color.FromArgb(85, 100, 217), Color.FromArgb(209, 230, 243), LinearGradientMode.Horizontal); LinearGradientBrush frmLGBR = new LinearGradientBrush(frmTitleR, Color.FromArgb(209, 230, 243), Color.FromArgb(85, 100, 217), LinearGradientMode.Horizontal); Pen frmPen = new Pen(Color.FromArgb(63, 119, 143), 1); g.FillRectangle(frmLGBL, frmTitleL); g.FillRectangle(frmLGBR, frmTitleR); g.DrawRectangle(frmPen, frmMessageBox); } private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MyMsgBox)); this.SuspendLayout(); // // MyMsgBox // this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(284, 262); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Name = "MyMsgBox"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.ShowInTaskbar = false; this.TopMost = true; this.Load += new System.EventHandler(this.MyMsgBox_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MyMsgBox_KeyDown); this.ResumeLayout(false); } private void MyMsgBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) //ESC键按下 { this.Close(); } } /// <summary> /// 控制弹出框永远在最上方 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MyMsgBox_Load(object sender, EventArgs e) { SetWindowLong(this.Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_TOOLWINDOW); SetWindowPos(this.Handle, (IntPtr)HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); this.TopMost = true; } } }

  

转载于:https://www.cnblogs.com/bryantzx/p/7813920.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_30493321/article/details/96767550

智能推荐

oracle 字符串截取判断,Oracle截取字符串和查找字符串_weixin_39716703的博客-程序员秘密

oracle 截取字符(substr),检索字符位置(instr) case when then else end语句使用 收藏常用函数:substr和instr1.SUBSTR(string,start_position,[length]) 求子字符串,返回字符串解释:string 元字符串start_position 开始位置(从0开始)length 可选项,子字符串的个数For e...

《程序员》杂志:成功开发推荐系统的十个关键点_cserchen的博客-程序员秘密

成功开发推荐系统的十个关键点应《程序员》杂志邀请写了篇文章,发表在今年第11期上,总结了一些推荐系统的开发体会,希望能对大家有帮助

java日志组件介绍(common-logging,log4j,slf4j,logback )_yycdaizi的博客-程序员秘密

common-loggingcommon-logging是apache提供的一个通用的日志接口。用户可以自由选择第三方的日志组件作为具体实现,像log4j,或者jdk自带的logging, common-logging会通过动态查找的机制,在程序运行时自动找出真正使用的日志库。当然,common-logging内部有一个Simple logger的简单实现,但是功能很弱。所以使用common-

opencv边缘检测报错15: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S)_cv2.contourarea error: (-215:assertion failed) npo_菜鸟小胖墩的博客-程序员秘密

opencv边缘检测报错这个问题困扰我好几天了我一直以为是图片路径问题,搞得我一直在重装python,最后发现是OpenCV边缘检测报错,通过这个博客发现修改如下就没报错了,记录下,好气呀def preProcess(image): ratio = image.shape[0] / 500.0 image = imutils.resize(image, height=500) grayImage = cv2.cvtColor(image, cv2.COL..

django auth模块详解_qq13650793239的博客-程序员秘密

auth模块是Django提供的标准权限管理系统,可以提供用户身份认证, 用户组和权限管理。auth可以和admin模块配合使用, 快速建立网站的管理系统。在INSTALLED_APPS中添加'django.contrib.auth'使用该APP, auth模块默认启用。UserUser是auth模块中维护用户信息的关系模式(继承了models.Model), 数据

Android Studio常用插件_hornsey2012的博客-程序员秘密

不得不承认,Android Studio越用越爽。其代码提示和搜索功能相当强大,非常智能。颜色、图片在布局和代码中可以实时预览。 开发的过程中使用一些插件可以事半功倍,下面介绍一些博主开发过程中常用到的一些as插件供大家参考。Android Studio常用插件ButterKnifecodotaGenymotion安装HAXMpostfixGosnF

随便推点

Cydia substrate Hook 和模拟器安装_yunshouhu的博客-程序员秘密

http://blog.csdn.net/xbalien29/article/details/22661479https://github.com/zencodex/cydia-android-hookhttp://www.cydiasubstrate.com/id/20cf4700-6379-4a14-9bc2-853fde8cc9d1/总的来说,要学习还是建议Xpo

2017-02-20 安装Sql Server2016+配置Java环境_AllenChoi0912的博客-程序员秘密

昨天在安装Sql Server 2016时,在前面的规则检查结果中,出现“Polybase要求安装Oracle JRE7更新51(64位)或更高版本”规则失败的错误,如图解决方案为,下载安装jdk,我这里安装的是jdk8,安装完后需要配置Java环境变量,配置完成后,重新运行检查,即可解决此问题。Java环境变量配置如下:计算机属性->高级系统设置->高级->环境变量新建环境变量J

Entity Framework工具POCO Code First Generator的使用_aaz071612的博客-程序员秘密

在使用Entity Framework过程中,有时需要借助工具生成Code First的代码,而Entity Framework Reverse POCO Code First Generator是一款不错的工具在Visual Studio中,通过“工具”→“扩展和更新...”来安装Entity Framework ReversePOCO Code First Generator...

RxJS的另外四种实现方式(一)——代码最小的库_rxjs6.3版本怎么调用实例方法_一个灰的博客-程序员秘密

接上篇RxJS的另外四种实现方式(序)起因想到这个库的原因,是看了callbag库想到的,callbag库的原理大家可以自己找资料了解,我就不多赘述,我只谈谈我的理解。callbag的设计思路是把消费者和生产者合并成一个,通过互相传递一个回调函数实现通讯。看过部分操作符实现原理的同学肯定觉得逻辑十分难解,因为过多的回调使得你的脑回路不够用了。我用了一些库函数后,我意识到,其实不需要如此复杂...

RGB渐变色C++_丶看我会发光的博客-程序员秘密

思路:添加关键值key,然后RGB3个分量分别插值#ifndef GRADCOLOR_HPP#define GRADCOLOR_HPP#include &lt;map&gt;#include &lt;vector&gt;class crgb{public: crgb(){ crgb(0,0,0,0); } crgb(int k, unsigned char _r, unsigned char _g, unsigned char _b): k

java服务器慢怎么检查_生产环境服务器变慢、CPU占用过高,诊断思路和性能评估谈谈?..._weixin_39833270的博客-程序员秘密

上篇:https://zhuanlan.zhihu.com/p/166162037​zhuanlan.zhihu.com一、生产环境服务器变慢,诊断思路和性能评估1、在Linxu准备数据(1)在Linux创建一个java循环类(方便测试),代码如下:package com.study.gc;public class javaDemo02 {public static void main(Strin...

推荐文章

热门文章

相关标签