Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2012
    Messaggi
    96

    [Visual Basic 2010]Creare un collegamento ad un file

    Mi servirebbe creare un collegamento ad un file (possibilmente scegliendo l'icona).
    Ho già trovato alcune guide (anche su questo sito) solo che in tutte quando il codice su vb10 mi da errore:
    codice:
    Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal _lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal _lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
    
            '
            'code to create the shortcut
            ' 
            Dim lReturn As Long
    
            'Add to Desktop
            lReturn = fCreateShellLink("..\..\Desktop", _
            "Shortcut to Calculator", "c:\Windows\calc.exe", "")
    
            'Add to Program Menu Group
            lReturn = fCreateShellLink("", "Shortcut to Calculator", _
            "c:\Windows\calc.exe", "")
    
            'Add to Startup Group
    
            'Note that on Windows NT, the shortcut will not actually appear
            'in the Startup group until your next reboot.
            'lReturn = fCreateShellLink("\Startup", "Shortcut to Calculator", _
            '"c:\Winnt\system32\calc.exe", "")
    Mi segna errore Declare e dice Parola chiave non valida come identificatore, di conseguenza anche fCreateShellLink dice 'fCreateShellLink' non dichiarato. Non è accessibile a causa del livello di protezione.
    Potete aiutarmi con un codice per vb10??

  2. #2
    Quel codice è per VB classic, non per VB.NET.

    Per VB.NET in internet trovi tantissimi esempi, basta cercare bene:
    https://www.google.it/search?q=vb.net+create+shortcut
    Chi non cerca trova.

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.