C# winform 打开设计时,也会执行编写的代码,
if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")//判断是否为设计时 {
return;
} if (Site == null || !this.Site.DesignMode)//运行时。。。 { }
参考:https://blog.csdn.net/weixin_30374009/article/details/98723380
if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")//判断是否为设计时 {
return;
} if (Site == null || !this.Site.DesignMode)//运行时。。。 { }
参考:https://blog.csdn.net/weixin_30374009/article/details/98723380