C# Winform 注册程序开机启动

2020-12-13 04:14

阅读:238

标签:winform   style   blog   color   os   art   

1 开机启动

public static bool SetAutoRun(string keyName, string filePath)
{
    try
    {
        RegistryKey Local= Registry.LocalMachine;
        RegistryKey runKey =Local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run\");
        runKey.SetValue(keyName, filePath);
        Local.Close();
    }
    catch
    {
        return false;
    }
    return true;
}

SetAutoRun("exeName", Application.StartupPath + "\\step.exe");

 

C# Winform 注册程序开机启动,搜素材,soscw.com

C# Winform 注册程序开机启动

标签:winform   style   blog   color   os   art   

原文地址:http://www.cnblogs.com/gordensong/p/3837390.html


评论


亲,登录后才可以留言!