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());
                }
            }
        }
    }

  • 相关阅读:
    SVN菜单说明
    Jabber Software:Jabber-NET、agsXMPP与Wilefire[转]
    nuget的使用总结
    SET QUOTED_IDENTIFIER ON
    SET ANSI_NULLS ON
    SQL Server性能杀手
    How to open .ccproj in VS2010?
    Bios里,把SATA Mode Selection改为AHCI无法启动
    [转]内嵌WORD/OFFICE的WINFORM程序——DSOFRAMER使用小结
    使用EF连接现有数据库
  • 原文地址:https://www.cnblogs.com/cl1006/p/7182531.html
Copyright © 2011-2022 走看看