Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it L'avatar di fedrock
    Registrato dal
    Jun 2009
    residenza
    Milan
    Messaggi
    342

    [VB.NET]Autorun

    Ciao sto progettando un piccolo programma e dovrei mettere che si avvii in automatico ad ogni avvio del PC , purtroppo non sō il codice che faccia svolgere questa funzione , se magari qualcuno sā il codice mi farebbe un grande favore , lo sō che chiedo troppo ma non saprei dove trovarlo .

    PS: uso vb 08

  2. #2
    Normalmente si mette uno shortcut del programma nel menu' Esecuzione Automatica di windows ...

  3. #3
    Utente di HTML.it L'avatar di fedrock
    Registrato dal
    Jun 2009
    residenza
    Milan
    Messaggi
    342
    mi potresti dire come si mette questo shortcut ? , io ho trovato questo :
    http://www.codeproject.com/KB/vb/StartupItem.aspx
    ma non ho capito bene come farlo

  4. #4
    Utente di HTML.it
    Registrato dal
    Apr 2009
    Messaggi
    191
    Hmm...Basta che crei un collegamento del tuo exe nella cartella "Esecuzione Automatica"...
    Vai su Start--->Tutti i programmi--->Esecuzione Automatica, tasto destro sopra di essa e clicca apri...Nella finestra che ti appare incolli il tuo collegamento...Ciao...

  5. #5
    Utente di HTML.it L'avatar di fedrock
    Registrato dal
    Jun 2009
    residenza
    Milan
    Messaggi
    342
    grazie a tutti ci sono riuscito e bastato creare un checkbox e mettere :
    If checkbox1.Checked Then
    AddCurrentKey("StartupExample", System.Reflection.Assembly.GetEntryAssembly.Locati on)
    Else
    RemoveCurrentKey("StartupExample")
    End If

    Ed inserire prima questo :
    Imports Microsoft.Win32
    Public Class Main

    Private Sub AddCurrentKey(ByVal name As String, ByVal path As String)
    Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsof t\Windows\CurrentVersion\Run", True)
    key.SetValue(name, path)
    End Sub

    Private Sub RemoveCurrentKey(ByVal name As String)
    Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsof t\Windows\CurrentVersion\Run", True)
    key.DeleteValue(name, False)
    End Sub

    Private Sub AddLocalKey(ByVal name As String, ByVal path As String)
    Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\Microso ft\Windows\CurrentVersion\Run", True)
    key.SetValue(name, path)
    End Sub

    Private Sub RemoveLocalKey(ByVal name As String)
    Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\Microso ft\Windows\CurrentVersion\Run", True)
    key.DeleteValue(name, False)
    End Sub

    ho scritto il codice in modo se qualkuno avrebbe lo stesso problema si possa aiutare da qui .

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.