zoukankan      html  css  js  c++  java
  • 判断是否在一台电脑只能打开一次

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using Microsoft.Win32;

    namespace B2B_Import
    {
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main()
            {
                try
                {
                    bool ret;
                    System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out ret);
                    if (ret)
                    {
                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);
                        RegistryKey loca_chek = Registry.LocalMachine;
                        RegistryKey run_Check = loca_chek.CreateSubKey(@"SOFTWAREMicrosoftWindowsCurrentVersionRun");
                        if (run_Check.GetValue("WinForm").ToString().ToLower() != "false")
                        {
                            Application.Run(new Main());
                        }
                        else
                        {
                            Application.Run(new Login());
                        }
                    }
                }
                catch
                {
                    //MessageBox.Show(ex.Message);
                    Application.Run(new Login());
                }
            }
        }
    }

  • 相关阅读:
    EasyUI Combobox组合框(模糊搜索、默认值绑定)
    Asp.Net下载文件时中途失败问题
    VS使用小技巧之——设置调试时启动项目和启动页
    VS使用小技巧之——给代码添加region
    VS使用小技巧之——引入整个文件夹
    VS使用小技巧之——任务列表
    FineUI给表格行内链接设置弹出窗体
    cnpm私服搭建和发布包
    阿里云产品术语和docker
    angularjs1.x的一些知识点整理
  • 原文地址:https://www.cnblogs.com/cl1006/p/7182531.html
Copyright © 2011-2022 走看看