• winform小记


    FormBorderStyle:None让边框消失

    private int time = 5;//停止五秒 //计时器 private void timer1_Tick(object sender, EventArgs e) { if (time!=0) { time; } else { this.timer1.Stop(); UserThisFunction(); } } 让程序停止几秒,我是这样做的。如果用线程的sleep方法的话,UI会不出来

    System.Environment.Exit(0); winform关闭程序

    RegistryKey keyroot = Registry.ClassesRoot;
                string flashkey = @"CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}";
                RegistryKey rkFlash = keyroot.OpenSubKey(flashkey);
                if (rkFlash == null)
                {
                    //System.Diagnostics.Process.Start(Application.StartupPath + "\\flash10.exe");
    
                    DialogResult dialog = MessageBox.Show("检测到您的电脑没有安装flash player,现在是否去官方下载所需插件?", "检测提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (dialog == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start("http://get.adobe.com/cn/flashplayer/");
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
                else
                {
                    frmMain f = new frmMain();
                    this.Hide();
                    Application.DoEvents();//中间加这句
                    f.ShowDialog();
                }

    winform检测是否安装了flash

     RegistryKey keyroot = Registry.ClassesRoot;
                string flashkey = @"CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}";
                RegistryKey rkFlash = keyroot.OpenSubKey(flashkey);
                if (rkFlash == null)
                {
                    System.Diagnostics.Process.Start(Application.StartupPath + "\\flash10.exe");
                }

    flash player安装文件放在bin目录下

  • 相关阅读:
    CentOS 7 如何设置默认启动方式为命令行模式
    Virtual Box配置CentOS7网络
    序列化后成对象转map,再添加到dataList
    centos7 ping: www.baidu.com: Name or service not known
    协议1
    idea查看接口方法实现
    centos关闭防火墙
    myeclipse配置svn
    eas固定ip避免多次申请许可
    jvm配置
  • 原文地址:https://www.cnblogs.com/hougelou/p/2854471.html
Copyright © 2020-2023  润新知