Oppure

Loading
10/11/09 13:36
steven991
Ragazzi ho un modulo che prende il nome del computer

Private Declare Function GetComputerName Lib "kernel32" _
                Alias "GetComputerNameA" (ByVal sBuffer As String, lSize As Long) As Long

Function getNomeComputer()
    Dim strString As String
    Dim lunghezzaStringa As Long
    lunghezzaStringa = 32 'La lunghezza massima del nome di un computer dovrebbe essere 31 caratteri
    strString = String(lunghezzaStringa, " ")
    GetComputerName strString, lunghezzaStringa
    strString = Left(strString, lunghezzaStringa)
    getNomeComputer = strString
End Function


e lo chiama con la stringa getNomeComputer.
Ora il mio programma uppa un file chiamato ciao.htm sul mio server ftp chiamandolo ciao.htm.

    nomefile = "ciao.htm"
        Inet1.Execute Inet1.URL, "PUT C:\ciao.htm " & nomefile


Ora essendo presente il modulo sopra citato, se scrivo

nomefile = "getComputerName.htm" il file me lo chiama sull'ftp proprio getComputerName.htm e non con la variabile del nome del computer. Come posso farei in modo che il nome del file sull'ftp lo prenda dalla variabile e che lo metta .htm?
aaa
10/11/09 14:56
ilmettiu
nomefile = getComputerName & ".htm"

Dovrebbe funzionare.
aaa
10/11/09 15:15
steven991
ah ecco avevo abbozzato a fare ".htm" ma era "&" che mi mancava. Grazie mille funziona, con getNomeComputer però , grazie:k:
aaa