Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786

    aiuto vb

    salve,

    ho questo compito:

    Le istruzioni per creare il programma in VB sono queste:

    -Aprite un progetto EXE Standard
    -Creare un command1, un text1 e una label1
    -Inserire un modulo
    -Nel modulo inserire questo:

    Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerial_Numberber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
    Public Const GETDI_SERIAL = 1


    Function GetDriveInfo(strDrive As String, iType As Integer)
    Dim Serial_Number As Long
    Dim Drive_Label As String
    Dim Fat_Type As String
    Dim Return_Value As Long
    Drive_Label = Space(256)
    Fat_Type = Space(256)
    Return_Value = GetVolumeInformation(strDrive, Drive_Label, Len(Drive_Label), Serial_Number, 0, 0, Fat_Type, Len(Fat_Type))
    GetDriveInfo = CStr(Serial_Number)
    End Function

    -Nel codice inserire questo:
    Private Sub Form_Load()
    Label1.Caption = GetDriveInfo("C:\", GETDI_SERIAL) 'mostra nella label1 il serial del nostro HDD
    End Sub

    Private Sub Command1_Click()
    directory = ("" & App.Path & "") + "zanna.x86" 'directory in cui si trova + zanna.x86
    passw = Label1.Caption - 86 'prende il serial sottrae 86
    passw = Left(passw, 9) 'poi prende in considerazione solo le prime 9 cifre partendo da sinistra
    passw = passw * 8686 'moltiplica poi x 8686
    passw = Right(passw, 6) 'considera solo le prime 6 cifre partendo da destra
    If Text1.Text = passw Then 'se il text1 è = alla password corretta...
    x = Shell(directory, 1) 'esegui il file zanna.x86...
    Else 'altrimenti...
    MsgBox "Errore" 'messaggio d'errore
    Unload Me 'esce
    End If
    End Sub

    çççççççççççççççççççççççççççççççççççççççççççççççççç ççççò

    il problema è che mi da questo errore quando inserisco il codice esatto:

    Run-time error '53':

    file not found

    come mai, cosa devo fare ?

    :master:
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  2. #2

    Re: aiuto vb

    Originariamente inviato da unreg
    salve,

    ho questo compito:

    Le istruzioni per creare il programma in VB sono queste:

    -Aprite un progetto EXE Standard
    -Creare un command1, un text1 e una label1
    -Inserire un modulo
    -Nel modulo inserire questo:

    Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerial_Numberber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
    Public Const GETDI_SERIAL = 1


    Function GetDriveInfo(strDrive As String, iType As Integer)
    Dim Serial_Number As Long
    Dim Drive_Label As String
    Dim Fat_Type As String
    Dim Return_Value As Long
    Drive_Label = Space(256)
    Fat_Type = Space(256)
    Return_Value = GetVolumeInformation(strDrive, Drive_Label, Len(Drive_Label), Serial_Number, 0, 0, Fat_Type, Len(Fat_Type))
    GetDriveInfo = CStr(Serial_Number)
    End Function

    -Nel codice inserire questo:
    Private Sub Form_Load()
    Label1.Caption = GetDriveInfo("C:\", GETDI_SERIAL) 'mostra nella label1 il serial del nostro HDD
    End Sub

    Private Sub Command1_Click()
    directory = ("" & App.Path & "") + "zanna.x86" 'directory in cui si trova + zanna.x86
    passw = Label1.Caption - 86 'prende il serial sottrae 86
    passw = Left(passw, 9) 'poi prende in considerazione solo le prime 9 cifre partendo da sinistra
    passw = passw * 8686 'moltiplica poi x 8686
    passw = Right(passw, 6) 'considera solo le prime 6 cifre partendo da destra
    If Text1.Text = passw Then 'se il text1 è = alla password corretta...
    x = Shell(directory, 1) 'esegui il file zanna.x86...
    Else 'altrimenti...
    MsgBox "Errore" 'messaggio d'errore
    Unload Me 'esce
    End If
    End Sub

    çççççççççççççççççççççççççççççççççççççççççççççççççç ççççò

    il problema è che mi da questo errore quando inserisco il codice esatto:

    Run-time error '53':

    file not found

    come mai, cosa devo fare ?

    :master:
    semplicemente perche alla shell non passi nessun file da aprire
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    mi puoi postare il codice giusto ?

    p.s. il file si chiama ff2c64o.x86

    e de nella stessa cartella del programma in questione.
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  4. #4
    cambiaquesta riga

    directory = ("" & App.Path & "") + "zanna.x86"

    così

    directory = app.path & "\zanna.x86"
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    non va, cosa posso fare ?

    p.s. se vuoi inviarmi un esempio funzionante, invialo a nino22@tiscali.it
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  6. #6
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    come posso fare ?

    up up
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  7. #7
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    questo è il codice,

    che ha ?

    Private Sub Form_Load()
    Label1.Caption = GetDriveInfo("C:\", GETDI_SERIAL) 'mostra nella label1 il serial del nostro HDD
    End Sub

    Private Sub Command1_Click()
    directory = ("" & App.Path & "") + "cd.exe"
    passw = Label1.Caption - 86 'prende il serial sottrae 86
    passw = Left(passw, 9) 'poi prende in considerazione solo le prime 9 cifre partendo da sinistra
    passw = passw * 8686 'moltiplica poi x 8686
    passw = Right(passw, 6) 'considera solo le prime 6 cifre partendo da destra
    If Text1.Text = passw Then 'se il text1 è = alla password corretta...
    x = Shell(directory, 1) 'esegui il file zanna.x86...
    Else 'altrimenti...
    MsgBox "Errore Password Errata !" 'messaggio d'errore
    Unload Me 'esce
    End If
    End Sub
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

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.