Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating unique file name
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00892107
Message ID:
00892142
Vues:
17
You may want call a API function. This is VB6 code:
Private Declare Function GetTempFileName _
                Lib "kernel32" _
                Alias "GetTempFileNameA" _
                (ByVal lpszPath As String, _
                ByVal lpPrefixString As String, _
                ByVal wUnique As Long, _
                ByVal lpTempFileName As String) As Long

Private Sub Form_Load()
Dim lngReturn As Long
Dim strBuffer As String
Dim strPath As String
    
    strBuffer = String$(255, 0)
    lngReturn = GetTempFileName(strPath, "EM", 0, ByVal strBuffer)
    MsgBox "You could use this string as a temp filename: " & Left$(strBuffer, lngReturn)
    
End Sub
>I read the help on this method and it indicates that the method will create a temp file (probably on the temp drive). But I need to create a unique string which I will pass to VFP stored procedure that will create a table of that name.
>But anyway, thank you for your help.
>
>>Have you tried Path.GetTempFileName ?
>>
>>>I need to create a unique file name similar to way it is done with
>>>
>>>SUBSTR(SYS(2015), 3, 10)
>>>
in VFP.
>>>
>>>Is there such a thing in .NET?
>>>
>>>Thank you.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform